Fix for bug #366, delete gear if hog is drowning (needed either that or a check on nil Gear^.Hedgehog^.Gear)
authornemo
Wed, 29 Feb 2012 18:24:56 -0500
changeset 6754 744b9430557a
parent 6753 e95b1f62d0de
child 6755 788bb2e0db21
Fix for bug #366, delete gear if hog is drowning (needed either that or a check on nil Gear^.Hedgehog^.Gear)
hedgewars/GSHandlers.inc
--- a/hedgewars/GSHandlers.inc	Wed Feb 29 23:44:49 2012 +0400
+++ b/hedgewars/GSHandlers.inc	Wed Feb 29 18:24:56 2012 -0500
@@ -1807,9 +1807,10 @@
                 State := State and (not gstAttacking);
                 Message := Message and (not gmAttack)
                 end;
-        DeleteGear(Gear)
+        DeleteGear(Gear);
+	exit;
         end;
-    CheckGearDrowning(HHGear)
+    if CheckGearDrowning(HHGear) then DeleteGear(Gear)
 end;
 
 procedure doStepRope(Gear: PGear);