wesnoth-cvs-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Wesnoth-cvs-commits] wesnoth/src actions.cpp


From: David White
Subject: [Wesnoth-cvs-commits] wesnoth/src actions.cpp
Date: Mon, 22 Nov 2004 19:41:09 -0500

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     David White <address@hidden>    04/11/23 00:35:21

Modified files:
        src            : actions.cpp 

Log message:
        fix to possible bug if WML kills a unit immediately before an attack

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/actions.cpp.diff?tr1=1.166&tr2=1.167&r1=text&r2=text

Patches:
Index: wesnoth/src/actions.cpp
diff -u wesnoth/src/actions.cpp:1.166 wesnoth/src/actions.cpp:1.167
--- wesnoth/src/actions.cpp:1.166       Sun Nov 21 21:15:56 2004
+++ wesnoth/src/actions.cpp     Tue Nov 23 00:35:20 2004
@@ -1,4 +1,4 @@
-/* $Id: actions.cpp,v 1.166 2004/11/21 21:15:56 silene Exp $ */
+/* $Id: actions.cpp,v 1.167 2004/11/23 00:35:20 Sirp Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -574,9 +574,10 @@
 
        std::map<gamemap::location,unit>::iterator a = units.find(attacker);
        std::map<gamemap::location,unit>::iterator d = units.find(defender);
-
-       assert(a != units.end());
-       assert(d != units.end());
+
+       if(a == units.end() || d == units.end()) {
+               return;
+       }
 
        int attackerxp = d->second.type().level();
        int defenderxp = a->second.type().level();




reply via email to

[Prev in Thread] Current Thread [Next in Thread]