mail[Wesnoth-commits] r44276 - /branches/1.8/src/actions.cpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by guillaume . melquiond on July 18, 2010 - 07:30:
Author: silene
Date: Sun Jul 18 07:30:48 2010
New Revision: 44276

URL: http://svn.gna.org/viewcvs/wesnoth?rev=44276&view=rev
Log:
Added test for invalidated death due to positive hp after the 'die' event. 
(Fix for bug #16261.)
Backported from trunk r44268.

Modified:
    branches/1.8/src/actions.cpp

Modified: branches/1.8/src/actions.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/branches/1.8/src/actions.cpp?rev=44276&r1=44275&r2=44276&view=diff
==============================================================================
--- branches/1.8/src/actions.cpp (original)
+++ branches/1.8/src/actions.cpp Sun Jul 18 07:30:48 2010
@@ -1418,20 +1418,14 @@
                game_events::fire("die", death_loc, attacker_loc, dat);
                refresh_bc();
 
-               if (!defender.valid()) {
+               if (!defender.valid() || defender.get_unit().hitpoints() > 0) 
{
                        // WML has invalidated the dying unit, abort
                        return false;
                }
-               if (defender.get_unit().hitpoints() <= 0) {
-                       units_.erase(defender.loc_);
-               }
-
-               if (!attacker.valid()) {
-                       // WML has invalidated the killing unit, abort
-                       return false;
-               }
-
-               if (attacker_stats->plagues)
+
+               units_.erase(defender.loc_);
+
+               if (attacker.valid() && attacker_stats->plagues)
                {
                        // plague units make new units on the target hex
                        LOG_NG << "trying to reanimate " << 
attacker_stats->plague_type << '\n';




Related Messages


Powered by MHonArc, Updated Sun Jul 18 09:20:12 2010