make hammer non-lethal again (as requested by unC0Rr)
authorsheepluva
Tue, 03 Nov 2015 21:18:25 +0100
changeset 11277 d63ef6afabe3
parent 11275 13ce106c8836
child 11278 f35b207087a6
make hammer non-lethal again (as requested by unC0Rr)
ChangeLog.txt
hedgewars/uGearsHandlersMess.pas
--- a/ChangeLog.txt	Tue Nov 03 21:43:56 2015 +0300
+++ b/ChangeLog.txt	Tue Nov 03 21:18:25 2015 +0100
@@ -1,6 +1,9 @@
 + features
 * bugfixes
 
+0.9.22 -> 0.9.23
+ * Hammer damage is now rounded down. This means it will cause NO DAMAGE to a hedgehog with less than 3 hp.
+
 0.9.21 -> 0.9.22
  + New Weapon / Map object: AirMine (floating mine that will follow nearby hedgehogs)
  + Extensive changes to TechRacer: Variable terrain types, enhanced parameters, hwmap interpreter, fuel limiter, etc. 
--- a/hedgewars/uGearsHandlersMess.pas	Tue Nov 03 21:43:56 2015 +0300
+++ b/hedgewars/uGearsHandlersMess.pas	Tue Nov 03 21:18:25 2015 +0100
@@ -5255,13 +5255,12 @@
                         d:= 2
                     else
                         d:= 3;
-                    // always round up
-                    if dmg mod d > 0 then
-                        dmg:= dmg div d + 1
-                    else
-                        dmg:= dmg div d;
-
-                    ApplyDamage(tmp, CurrentHedgehog, dmg, dsUnknown);
+
+                    // always rounding down
+                    dmg:= dmg div d;
+
+                    if dmg > 0 then
+                        ApplyDamage(tmp, CurrentHedgehog, dmg, dsUnknown);
                     end;
                 end;