Comment 4 for bug 1302593

Revision history for this message
SirVer (sirver) wrote : Re: Result screen for autocrat not shown when the game has been loaded

So some kind of relief here: The Lua persistence seems to be working correct and okay. This is what happens: 01_defeat_all.lua starts out with a list of all players and removes them one by one as they are marked as being defeated. As soon as all players/fractions are accounted for, it calls wl.game.report_result.

This will call PlayerManager::add_player_end_status() which will show the result screen as soon as it has results for all players. However, these are not persisted into the savegame - i.e. when you defeat one enemy it will be marked as being defeated. When you reload the game after saving, it will no longer be marked as defeated. But since the lua table no longer contains the player (since it got removed the first time it was reported) it will not get reported again -> you will never see the results screen.

I personally think it would be better to keep the state entirely in Lua and only report the results of the game once (at the end of the game). Other solution would be to save the state of the Players Manager to disk.

Charly, I assign you since you made this feature. Maybe you want to look into this bug too?