XProger / OpenLara

Classic Tomb Raider open-source engine
http://xproger.info/projects/OpenLara/
BSD 2-Clause "Simplified" License
4.71k stars 364 forks source link

Correcting level arguments while initializing game (platform/win). #459

Closed cos1110 closed 1 year ago

cos1110 commented 1 year ago

https://github.com/XProger/OpenLara/blob/7a021b6edeb145372b572cddc400caaa3f3ad8a6/src/platform/win/main.cpp#LL1089C3-L1089C3

According to some testing:

strstr(argv[1], "--")
0x015f5f83 "--01-Caves.PHD"

strstr(argv[1], "--") == argv[1]
true

argc > 1 && strstr(argv[1], "--") == argv[1]
true
XProger commented 1 year ago

the original game doesn't have such file names

cos1110 commented 1 year ago

I was able to overload the command line argument and load a custom level, I found somewhere. Everything runs nicely, however I had to change the boolean operator to == in order to load the custom level as such.