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: Sat, 29 Jan 2005 22:44:52 -0500

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     David White <address@hidden>    05/01/30 03:44:52

Modified files:
        src            : actions.cpp 

Log message:
        fixed bug where a unit with greater than its maximum hitpoints couldn't 
be cured of poison

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

Patches:
Index: wesnoth/src/actions.cpp
diff -u wesnoth/src/actions.cpp:1.186 wesnoth/src/actions.cpp:1.187
--- wesnoth/src/actions.cpp:1.186       Sat Jan 29 01:06:55 2005
+++ wesnoth/src/actions.cpp     Sun Jan 30 03:44:51 2005
@@ -1,4 +1,4 @@
-/* $Id: actions.cpp,v 1.186 2005/01/29 01:06:55 silene Exp $ */
+/* $Id: actions.cpp,v 1.187 2005/01/30 03:44:51 Sirp Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -1018,7 +1018,7 @@
                //the unit heals if it's on this side, and it's on a village or
                //it has regeneration, and it is wounded
                if(i->second.side() == side) {
-                       if(i->second.hitpoints() < i->second.max_hitpoints()){
+                       if(i->second.hitpoints() < i->second.max_hitpoints() || 
i->second.poisoned()){
                                if(map.gives_healing(i->first) || 
i->second.type().regenerates()) {
                                        amount_healed = 
game_config::cure_amount;
                                }
@@ -1096,7 +1096,7 @@
        //are no longer poisoned
        for(i = units.begin(); i != units.end(); ++i) {
 
-               if(i->second.side() == side && i->second.has_flag("poisoned")) {
+               if(i->second.side() == side && i->second.poisoned()) {
                        const int damage = 
minimum<int>(game_config::cure_amount,
                                                        
i->second.hitpoints()-1);
 
@@ -1109,7 +1109,7 @@
        for(i = units.begin(); i != units.end(); ++i) {
                if(i->second.side() == side) {
                        if(i->second.hitpoints() < i->second.max_hitpoints() || 
-                                       i->second.has_flag("poisoned")){
+                                       i->second.poisoned()){
                                if(i->second.is_resting()) {
                                        const 
std::map<gamemap::location,int>::iterator u =
                                                healed_units.find(i->first);




reply via email to

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