# HG changeset patch
# User nemo
# Date 1330557896 18000
# Node ID 744b9430557a85021f6b528b8c9cdb3b2fc54f85
# Parent  e95b1f62d0decbc5623d04a2c7e41f78d4a7b699
Fix for bug #366, delete gear if hog is drowning (needed either that or a check on nil Gear^.Hedgehog^.Gear)

diff -r e95b1f62d0de -r 744b9430557a 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);