bugBos Wars - Bugs: bug #28943, cannot win in swindler level 1...

 
 

bug #28943: cannot win in swindler level 1 after saving & loading the game

Submitted by:  Kalle Olavi Niemitalo <kon>
Submitted on:  Sat 20 Feb 2010 03:52:32 PM UTC  
 
Severity: 4 - ImportantItem Group: Bug
Status: FixedPrivacy: Public
Assigned to: François Beerten <feb>Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sun 21 Mar 2010 03:16:56 PM UTC, comment #2:

Fixed in the development version. Thank you for the report.

François Beerten <feb>
Project AdministratorIn charge of this item.
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)

Kalle Olavi Niemitalo <kon>
Project Member
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.

Kalle Olavi Niemitalo <kon>
Project Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by feb (Updated the item)
  • -unavailable- added by kon (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 21 Mar 2010 03:16:56 PM UTCfebStatusNone=>Fixed
      Assigned toNone=>feb
      Open/ClosedOpen=>Closed
    Sat 20 Feb 2010 08:28:10 PM UTCfebSeverity3 - Normal=>4 - Important

    Back to the top


    Powered by Savane 3.1-cleanup1