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

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

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


From: Guillaume Melquiond
Subject: [Wesnoth-cvs-commits] wesnoth ./changelog src/actions.cpp src/unit.cpp
Date: Fri, 07 Jan 2005 19:06:32 -0500

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     Guillaume Melquiond <address@hidden>    05/01/07 22:09:09

Modified files:
        .              : changelog 
        src            : actions.cpp unit.cpp 

Log message:
        Use heal instead of negative hit so that drain can't go past max hp 
anymore.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/changelog.diff?tr1=1.431&tr2=1.432&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/actions.cpp.diff?tr1=1.180&tr2=1.181&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/unit.cpp.diff?tr1=1.111&tr2=1.112&r1=text&r2=text

Patches:
Index: wesnoth/changelog
diff -u wesnoth/changelog:1.431 wesnoth/changelog:1.432
--- wesnoth/changelog:1.431     Sun Jan  2 21:15:24 2005
+++ wesnoth/changelog   Fri Jan  7 22:09:08 2005
@@ -44,6 +44,7 @@
  * "," is no longer the column separator, it does not have to be escaped
    anymore in some translations, "=" is the new separator
  * clarify some ability descriptions
+ * remove drain allowing to go past maximum hp
  * fix pathfinding bug (#11196)
  * fix untranslatable strings
  * fix "damage inflicted" statistic (incorrectly computed when defending)
Index: wesnoth/src/actions.cpp
diff -u wesnoth/src/actions.cpp:1.180 wesnoth/src/actions.cpp:1.181
--- wesnoth/src/actions.cpp:1.180       Sun Jan  2 22:09:24 2005
+++ wesnoth/src/actions.cpp     Fri Jan  7 22:09:09 2005
@@ -1,4 +1,4 @@
-/* $Id: actions.cpp,v 1.180 2005/01/02 22:09:24 silene Exp $ */
+/* $Id: actions.cpp,v 1.181 2005/01/07 22:09:09 silene Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -651,7 +651,7 @@
                                        char buf[50];
                                        
sprintf(buf,"%d",stats.amount_attacker_drains);
                                        gui.float_label(a->first,buf,0,255,0);
-                                       
a->second.gets_hit(-stats.amount_attacker_drains);
+                                       
a->second.heal(stats.amount_attacker_drains);
                                }
                        }
 
@@ -797,8 +797,7 @@
                                        char buf[50];
                                        
sprintf(buf,"%d",stats.amount_defender_drains);
                                        gui.float_label(d->first,buf,0,255,0);
-
-                                       
d->second.gets_hit(-stats.amount_defender_drains);
+                                       
d->second.heal(stats.amount_defender_drains);
                                }
                        }
                                
Index: wesnoth/src/unit.cpp
diff -u wesnoth/src/unit.cpp:1.111 wesnoth/src/unit.cpp:1.112
--- wesnoth/src/unit.cpp:1.111  Sat Jan  1 00:44:50 2005
+++ wesnoth/src/unit.cpp        Fri Jan  7 22:09:09 2005
@@ -1,4 +1,4 @@
-/* $Id: unit.cpp,v 1.111 2005/01/01 00:44:50 Sirp Exp $ */
+/* $Id: unit.cpp,v 1.112 2005/01/07 22:09:09 silene Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -409,10 +409,11 @@
 
 void unit::heal(int amount)
 {
-       if(hitpoints_ < max_hitpoints()) {
+       int max_hp = max_hitpoints();
+       if (hitpoints_ < max_hp) {
                hitpoints_ += amount;
-               if(hitpoints_ > max_hitpoints())
-                       hitpoints_ = max_hitpoints();
+               if (hitpoints_ > max_hp)
+                       hitpoints_ = max_hp;
        }
 }
 




reply via email to

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