alexbatalov / fallout2-ce

Fallout 2 for modern operating systems
Other
1.79k stars 123 forks source link

Sfall: add support for loading mods / mod_order.txt #392

Open JanSimek opened 5 months ago

JanSimek commented 5 months ago

Loads mods from the mods directory based on their order in the mods/mods_order.txt file.

This feature is a prerequisite to get the Restoration Patch working.

See https://github.com/sfall-team/sfall/discussions/450#discussioncomment-5849010

Tested only on linux using data file from test_artemple.dat.zip which changes some tiles in the initial map artemple.map

phobos2077 commented 5 months ago

Maybe move the code to one of sfall_*.cc files to keep vanilla code clean?

phobos2077 commented 5 months ago

Have you looked at the original code? https://github.com/sfall-team/sfall/blob/b3ec9f1faa9e1bba1c71353b90f751a255ef3c71/sfall/Modules/LoadOrder.cpp#L266

There seem to be a couple of steps missing like disallowing paths to go outside of the game folder and checking if string is empty.

JanSimek commented 5 months ago

Thanks, I added a check for empty lines. Relative paths from the mods directory and neither absolute paths won't work. However, that could be easily overcome by creating a symlink anyway.