Fix Birdy descending into water if hog took damage before it got picked up (bug 160)
authorWuzzy <almikes@aol.com>
Wed, 04 Oct 2017 18:34:02 +0200
changeset 12649 59b46e6f36ff
parent 12648 5bc6fb5da42f
child 12650 a4a04a700153
Fix Birdy descending into water if hog took damage before it got picked up (bug #160)
ChangeLog.txt
hedgewars/uGearsHandlersMess.pas
--- a/ChangeLog.txt	Wed Oct 04 16:09:28 2017 +0200
+++ b/ChangeLog.txt	Wed Oct 04 18:34:02 2017 +0200
@@ -46,6 +46,7 @@
  * Fixed hedgehogs not saying “Stupid” and not displaying announcer message for inflicting self-harm
  * Fixed incorrect time box tooltip when in Sudden Death
  * Fixed cake taking over 200 seconds to explode when its stuck and can't move
+ * Fixed Birdy descending into water when hog took damage or died before it got picked up
  * Remove buggy /finish chat command
  * Various other fixes
 
--- a/hedgewars/uGearsHandlersMess.pas	Wed Oct 04 16:09:28 2017 +0200
+++ b/hedgewars/uGearsHandlersMess.pas	Wed Oct 04 18:34:02 2017 +0200
@@ -4182,8 +4182,9 @@
         dec(Gear^.Timer, 1);
 
     HHGear := Gear^.Hedgehog^.Gear;
-    if HHGear = nil then
-        begin
+    if (HHGear = nil) or ((HHGear^.State and gstHHDriven) = 0) then
+        begin
+        Gear^.Hedgehog := nil;
         Gear^.Timer := 0;
         Gear^.State := Gear^.State or gstAnimation or gstTmpFlag;
         Gear^.Timer := 0;