Sun 21 Feb 2010 07:43:07 AM UTC, comment #1:
This bug is already reproducible in the tutorial of branches/boswars-2.5 r9536 + minor gcc compatibility patches (r9581, r9543, r9553). So the bug is not a new one, but the swindler campaign makes it worse, because players are more likely to save there than in the tutorial.
The backtrace for how CclAddTrigger is called when the game is loaded:
#0 CclAddTrigger (l=0x1f9d230) at engine/game/trigger.cpp:543
#1 0x00007fe97ab334b1 in luaD_precall () from /usr/lib/liblua50.so.5.0
#2 0x00007fe97ab3d047 in luaV_execute () from /usr/lib/liblua50.so.5.0
#3 0x00007fe97ab33970 in luaD_call () from /usr/lib/liblua50.so.5.0
#4 0x00007fe97ab33097 in luaD_rawrunprotected () from /usr/lib/liblua50.so.5.0
#5 0x00007fe97ab331c5 in luaD_pcall () from /usr/lib/liblua50.so.5.0
#6 0x00007fe97ab2f7b4 in lua_pcall () from /usr/lib/liblua50.so.5.0
#7 0x000000000047faef in LuaCall (narg=0, clear=1, exitOnError=true) at engine/stratagus/script.cpp:187
#8 0x000000000044fc18 in InitTriggers () at engine/game/trigger.cpp:770
#9 0x00000000004580dd in InitModules () at engine/game/loadgame.cpp:139
#10 0x0000000000458313 in LoadGame (filename=...) at engine/game/loadgame.cpp:218
#11 0x00000000004813e1 in StartSavedGame (filename=...) at engine/stratagus/stratagus.cpp:422
#12 0x000000000050b268 in tolua_stratagus_StartSavedGame00 (tolua_S=0x1f9d230) at engine/tolua/tolua.cpp:16330
(the rest is how the Load Game button was clicked and so on)
|
Sat 20 Feb 2010 03:52:32 PM UTC, original submission:
In level 1 of the swindler campaign in Bos Wars svn trunk r9636, you're supposed to win if you can get Lahen to the camera near the eastern edge of the map. However, if you save the game, exit to the menu, and load the saved game, then Bos Wars won't notice your getting to the camera, so you cannot win.
campaigns/swindler/level01.sms includes two AddTrigger calls that set up the victory and defeat conditions. When saving the game, Bos Wars writes SetActiveTriggers(true) and SetTrigger(0) to the save file but does not copy the AddTrigger calls there. When Bos Wars loads the game again, it notices the SavedGameInfo({ ..., SaveFile = "campaigns/tutorial/level01.smp" }) call in the save file and loads campaigns/tutorial/level01.smp; but it does not load campaigns/swindler/level01.sms, where the triggers are defined. Instead, InitTriggers (in engine/game/trigger.cpp) notices that the triggers are missing, and calls SinglePlayerTriggers (in scripts/boswars.lua), which then defines default triggers that expect you to kill all enemy units. I verified this by setting a breakpoint in CclAddTrigger.
Although this loss of triggers is most serious in the swindler campaign, it is easiest to test in the tutorial. Start the tutorial campaign, save the game, exit to the menu, and load the game. If the bug is there, you win instantly because there are no enemies.
|