Opened 9 years ago

Last modified 8 years ago

#3581 closed defect

[PATCH] Visual Replay - simulation continues after end — at Version 1

Reported by: elexis Owned by:
Priority: Should Have Milestone: Alpha 19
Component: Core engine Keywords: patch
Cc: Patch:

Description (last modified by elexis)

Once the replay ends, the simulation continues internally. With AIs it becomes noticable as they continue the game as if nothing has happened.

You can easily reproduce it by replaying the attached file with only one turn, clicking "no" on the exit question and then see the AI continue to build stuff.


The cause of this bug, i.e. the turn manager continuing after the end exists since #9 / r16727, but it never got apparent until both #3309 and #3566 were fixed. Presumably the last mock turn with a duration 0 prevented the game from continuing.

When I apply this attachment:visual_replay_a18_megapatch.patch:ticket:9 to my a18 and replay that file, the units continue with their current animation but all keep standing on ground, despite the turn manager doing more turns.

Change History (3)

by elexis, 9 years ago

Attachment: commands.txt added

comment:1 by elexis, 9 years ago

Description: modified (diff)
Keywords: patch review added
Milestone: BacklogAlpha 19
Summary: Visual Replay - simulation continues after end[PATCH] Visual Replay - simulation continues after end

The problem is that main.cpp calling Frame() in a loop, calling g_Game->Update() as long as the game exists and was started, calling m_TurnManager->Update() every time which always increases the turnnumber by 1.

So the simple solution is to move the m_FinalReplayTurn from ReplayTurnManager to the parent class NetTurnManager, so that the parent class function Update() knows about potentially finite games.

Note: See TracTickets for help on using tickets.