[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Wesnoth-cvs-commits] wesnoth/src game_events.cpp
From: |
David White |
Subject: |
[Wesnoth-cvs-commits] wesnoth/src game_events.cpp |
Date: |
Sat, 02 Oct 2004 11:27:54 -0400 |
CVSROOT: /cvsroot/wesnoth
Module name: wesnoth
Branch:
Changes by: David White <address@hidden> 04/10/02 15:20:59
Modified files:
src : game_events.cpp
Log message:
fixed bug where firing events from a kill event could cause crashes
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/game_events.cpp.diff?tr1=1.107&tr2=1.108&r1=text&r2=text
Patches:
Index: wesnoth/src/game_events.cpp
diff -u wesnoth/src/game_events.cpp:1.107 wesnoth/src/game_events.cpp:1.108
--- wesnoth/src/game_events.cpp:1.107 Mon Sep 27 00:24:41 2004
+++ wesnoth/src/game_events.cpp Sat Oct 2 15:20:59 2004
@@ -1,4 +1,4 @@
-/* $Id: game_events.cpp,v 1.107 2004/09/27 00:24:41 ydirson Exp $ */
+/* $Id: game_events.cpp,v 1.108 2004/10/02 15:20:59 Sirp Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -400,6 +400,7 @@
//modifications of some attributes of a side: gold, income, team name
else if(cmd == "modify_side") {
+ std::cerr << "modifying side...\n";
const std::string& side = cfg["side"];
const std::string& income = cfg["income"];
const std::string& team_name = cfg["team_name"];
@@ -408,7 +409,9 @@
const size_t team_index = side_num-1;
if(team_index < teams->size()) {
+ std::cerr << "modifying team: " << team_index << "\n";
if(!team_name.empty()) {
+ std::cerr << "change team to team_name '" <<
team_name << "'\n";
(*teams)[team_index].change_team(team_name);
}
@@ -1032,7 +1035,8 @@
}
else if(cmd == "kill") {
- for(unit_map::iterator un = units->begin(); un !=
units->end();) {
+ unit_map::iterator un = units->begin();
+ while(un != units->end()) {
if(game_events::unit_matches_filter(un,cfg)) {
if(cfg["animate"] == "yes") {
screen->scroll_to_tile(un->first.x,un->first.y,display::WARP);
@@ -1042,6 +1046,11 @@
if(cfg["fire_event"] == "yes") {
gamemap::location loc = un->first;
game_events::fire("die",loc,un->first);
+ un = units->find(loc);
+ if(un == units->end()) {
+ un = units->begin();
+ continue;
+ }
}
units->erase(un++);
} else {
- [Wesnoth-cvs-commits] wesnoth/src game_events.cpp,
David White <=