Atlantean Mission Trigger fail

Bug #1311244 reported by Tino
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
widelands
Fix Released
High
Unassigned

Bug Description

Two days ago i played and finished the atlantean mission with r6952.

Today i loaded one of the automatic savegames (atl_build.wgf, renamed) with r6958.
After some time i got the task to build the horsefarm and warehouse (atl_1_build_horsefarm.wgf).
These two buildings already existed at this point.

Now you can play the game a long time (still_no_trigger.swf), but the water rising does not start

Revision history for this message
Tino (tino79) wrote :
Revision history for this message
SirVer (sirver) wrote :

It seems that all the common lua state is no longer common after loading. let_the_water_rise is false when I load your game and I do not understand why the msg box is shown though.

Changed in widelands:
status: New → Confirmed
importance: Undecided → High
milestone: none → build19-rc1
tags: added: atlanteans campaign lua savegame
Revision history for this message
SirVer (sirver) wrote :

Should be fixed in 6965 (which broke savegame compatibility again). I was unable to reproduce the problem in a test case though, so I theorycrafted the solution.

The problem was that on each Coroutine game command, the whole coroutine was saved into the savegame. This was bad for multiple reasons, one was that the single global Lua state was fractured into many lua states on save and we hoped for the best when loading to reassemble a single state.

In r6965 I changed the code to only save the global lua state once - but inside the luastate (in a global table named __coroutine_registry) we keep a reference to each coroutine. When we now save a 'coroutine' we only save the index of its reference into this table. On load, we must make sure that the global lua state is loaded before any coroutine cmdqueue is loaded, but then restoring these commands is simply looking up the index that we saved to the file and we have the coroutine again.

This is an awesome fix: it is more correct, faster, results in smaller save games and is simpler in the code.

I think this should fix these problems. Playtesting would be very much appreciated because as said, I was unable to construct a test case.

Changed in widelands:
status: Confirmed → Fix Committed
GunChleoc (gunchleoc)
Changed in widelands:
status: Fix Committed → Fix Released
Revision history for this message
GunChleoc (gunchleoc) wrote :

Fixed in build19-rc1.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.