Fix Birdy descending into water if hog took damage before it got picked up (
bug #160)
--- 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;