Author: mordante
Date: Sun Apr 8 19:06:50 2007
New Revision: 16694
URL: http://svn.gna.org/viewcvs/wesnoth?rev=16694&view=rev
Log:
with a move attack action if the moveto event moves the defender Wesnoth would
crash (part 1 of bug #8882)
Modified:
branches/1.2/changelog
branches/1.2/src/mouse_events.cpp
Modified: branches/1.2/changelog
URL:
http://svn.gna.org/viewcvs/wesnoth/branches/1.2/changelog?rev=16694&r1=16693&r2=16694&view=diff
==============================================================================
--- branches/1.2/changelog (original)
+++ branches/1.2/changelog Sun Apr 8 19:06:50 2007
@@ -37,6 +37,8 @@
* used valgrind to find some memory problems fixes bug #8715, bug #8756 and
bug #8839
* fixed Ethiliel not showing up in the scenario "Vengeance" of TSG
+ * with a move attack action if the moveto event moves the defender Wesnoth
+ would crash (part 1 of bug #8882)
Version 1.2.3:
* campaigns:
Modified: branches/1.2/src/mouse_events.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/branches/1.2/src/mouse_events.cpp?rev=16694&r1=16693&r2=16694&view=diff
==============================================================================
--- branches/1.2/src/mouse_events.cpp (original)
+++ branches/1.2/src/mouse_events.cpp Sun Apr 8 19:06:50 2007
@@ -1026,8 +1026,10 @@
const gamemap::location& attack_from =
current_unit_attacks_from(hex, nearest_hex, second_nearest_hex);
if(attack_from.valid()) {
if(move_unit_along_current_route(false)) { //move the
unit without updating shroud
+ // a WML event could have invalidated both
attacker and defender
+ // so make sure they're valid before attacking
u = find_unit(attack_from);
- // enemy = find_unit(hex);
+ enemy = find_unit(hex);
if(u != units_.end() && u->second.side() ==
team_num_ &&
enemy != units_.end() &&
current_team().is_enemy(enemy->second.side()) &&
!enemy->second.incapacitated()) {
//if shroud or fog is active,
rememember nits a and after attack check if someone isn`t seen
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits