[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Wesnoth-cvs-commits] wesnoth/src actions.cpp game_events.hpp
From: |
Philippe Plantier |
Subject: |
[Wesnoth-cvs-commits] wesnoth/src actions.cpp game_events.hpp |
Date: |
Tue, 13 Sep 2005 15:34:57 -0400 |
CVSROOT: /cvsroot/wesnoth
Module name: wesnoth
Branch:
Changes by: Philippe Plantier <address@hidden> 05/09/13 19:34:57
Modified files:
src : actions.cpp game_events.hpp
Log message:
Fixed #14426, which is was a much more severe bug that could be
inferred from
reading its description.
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/actions.cpp.diff?tr1=1.241&tr2=1.242&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/game_events.hpp.diff?tr1=1.29&tr2=1.30&r1=text&r2=text
Patches:
Index: wesnoth/src/actions.cpp
diff -u wesnoth/src/actions.cpp:1.241 wesnoth/src/actions.cpp:1.242
--- wesnoth/src/actions.cpp:1.241 Mon Sep 12 21:36:04 2005
+++ wesnoth/src/actions.cpp Tue Sep 13 19:34:56 2005
@@ -1,4 +1,4 @@
-/* $Id: actions.cpp,v 1.241 2005/09/12 21:36:04 gruikya Exp $ */
+/* $Id: actions.cpp,v 1.242 2005/09/13 19:34:56 gruikya Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://www.wesnoth.org/
@@ -1686,7 +1686,7 @@
|| teams[team].is_enemy(sighted->second.side()) == false)) {
if(seen_units == NULL || known_units == NULL) {
static const std::string sighted("sighted");
- game_events::fire(sighted,*it,loc);
+ game_events::raise(sighted,*it,loc);
} else if(known_units->count(*it) == 0) {
seen_units->insert(*it);
}
@@ -1711,6 +1711,7 @@
clear_shroud_unit(map,status,gamedata,units,i->first,teams,team,NULL,NULL);
}
}
+ game_events::pump();
}
bool clear_shroud(display& disp, const gamestatus& status,
@@ -1730,6 +1731,7 @@
result |=
clear_shroud_unit(map,status,gamedata,units,i->first,teams,team,NULL,NULL);
}
}
+ game_events::pump();
recalculate_fog(map,status,gamedata,units,teams,team);
@@ -1910,7 +1912,9 @@
}
}
- const bool event_mutated = game_events::fire("moveto",steps.back());
+ bool event_mutated = false;
+ if (game_events::fire("moveto",steps.back()))
+ event_mutated = true;
if(undo_stack != NULL) {
if(event_mutated || should_clear_stack) {
@@ -2074,8 +2078,18 @@
//we have to swap out any unit that is already in the
hex, so we can put our
//unit there, then we'll swap back at the end.
const temporary_unit_placer
unit_placer(units,*step,un->affected_unit);
-
clear_shroud_unit(map,status,gamedata,units,*step,teams,team,NULL,NULL);
+
+ //FIXME
+ //there is potential for a bug, here. If the "sighted"
+ //events, raised by the clear_shroud_unit function,
+ //loops on all units, changing them all, the unit which
+ //was swapped by the temporary unit placer will not be
+ //affected. However, if we place the pump() out of the
+ //temporary_unit_placer scope, the "sighted" event will
+ //be raised with an invalid source unit, which is even
+ //worse.
+ game_events::pump();
}
}
if(disp != NULL) {
Index: wesnoth/src/game_events.hpp
diff -u wesnoth/src/game_events.hpp:1.29 wesnoth/src/game_events.hpp:1.30
--- wesnoth/src/game_events.hpp:1.29 Sat Jul 2 21:37:18 2005
+++ wesnoth/src/game_events.hpp Tue Sep 13 19:34:56 2005
@@ -1,4 +1,4 @@
-/* $Id: game_events.hpp,v 1.29 2005/07/02 21:37:18 ott Exp $ */
+/* $Id: game_events.hpp,v 1.30 2005/09/13 19:34:56 gruikya Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://www.wesnoth.org/
@@ -64,6 +64,10 @@
//function to fire an event. Events may have up to two arguments, both of
//which must be locations.
bool fire(const std::string& event,
+ const gamemap::location& loc1=gamemap::location::null_location,
+ const gamemap::location& loc2=gamemap::location::null_location);
+
+void raise(const std::string& event,
const gamemap::location& loc1=gamemap::location::null_location,
const gamemap::location& loc2=gamemap::location::null_location);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Wesnoth-cvs-commits] wesnoth/src actions.cpp game_events.hpp,
Philippe Plantier <=