URL:
<http://gna.org/bugs/?21776>
Summary: Replays of reloaded games skip 'preload' event
handlers
Project: Battle for Wesnoth
Submitted by: slowthinker
Submitted on: Sun Mar 9 20:43:26 2014
Category: Bug
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: None of the others
Status: None
Privacy: Public
Assigned to: None
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release: 1.10.7
Operating System: Windows XP
_______________________________________________________
Details:
Imagine this situation:
1. a game is started
2. 'preload' events are fired
3. the game continues
4. the game is saved and reloaded
5. 'preload' events are fired 2nd time
6. the game continues
7. the game is saved and replayed
The replay will skip point 5. Therefore OOS may occur during the replay.
An example:
The code bellow will behave this way:
in a game: it will write 'reloaded_game=no' before the game reload and
'reloaded_game=yes' after the reload
in a replay:
it will always write 'reloaded_game=no'
[event]
name=prestart
first_time_only=yes
{VARIABLE start_passed yes}
[/event]
[event]
name=preload
first_time_only=no
[if]
{VARIABLE_CONDITIONAL start_passed not_equals yes}
[then]
# this is a very start of the game
{VARIABLE reloaded_game no}
[/then]
[else]
# this is a reloaded game
{VARIABLE reloaded_game yes}
[/else]
[/if]
[/event]
[event]
name=side turn
first_time_only=no
[chat]
speaker=Debug info
message="reloaded_game=$reloaded_game"
[/chat]
[/event]
_______________________________________________________
Reply to this item at:
<http://gna.org/bugs/?21776>
_______________________________________________
Message sent via/by Gna!
http://gna.org/
_______________________________________________
Wesnoth-bugs mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-bugs