Fixed an unitialized variable,

...and fixed move-interrupting events not blocking undo
This commit is contained in:
Silas Brill 2012-05-01 08:40:51 +00:00
parent 666946a384
commit 2b4303923e
2 changed files with 6 additions and 1 deletions

View File

@ -1,4 +1,5 @@
#textdomain wesnoth
#textdomain wesnoth
# @file data/scenario-test.cfg
[test]
@ -221,6 +222,8 @@ Uu, Uu, Uu, Uu, Uu, Uu, Uu, Uu, Uu, Uu, Uu, Uu, Uu"
radius=1
terrain=Xu
[/terrain]
[allow_undo]
[/allow_undo]
[/event]
# Moveto test
@ -230,6 +233,7 @@ Uu, Uu, Uu, Uu, Uu, Uu, Uu, Uu, Uu, Uu, Uu, Uu, Uu"
[filter]
x=6
y=1-4
[/filter]
[message]

View File

@ -2505,6 +2505,7 @@ struct movement_surprises {
sighted_stop(false),
teleport_failed(false),
event_stop(false),
event_mutated(false),
display_changed(false),
sighted_something(false),
block_undo(false),
@ -3416,7 +3417,7 @@ size_t move_unit(move_unit_spectator *move_spectator,
int orig_village_owner = -1;
int action_time_bonus = 0;
if(ui != units.end()) {
stops.event_mutated = movement_events(initial_loc, final_loc, stops, should_clear_shroud,
stops.event_mutated |= movement_events(initial_loc, final_loc, stops, should_clear_shroud,
orig_village_owner, action_time_bonus);
//NOTE: an wml event may have removed the unit pointed by ui
ui = units.find(final_loc);