Add drown-the-playing-hog check for case of piano falling off the landscape.
authornemo
Tue, 04 May 2010 16:30:41 +0000
changeset 3419 b66a1b597f88
parent 3418 8545f646a40d
child 3420 c89c2ba31da8
Add drown-the-playing-hog check for case of piano falling off the landscape.
hedgewars/GSHandlers.inc
--- a/hedgewars/GSHandlers.inc	Tue May 04 15:43:31 2010 +0000
+++ b/hedgewars/GSHandlers.inc	Tue May 04 16:30:41 2010 +0000
@@ -3219,7 +3219,18 @@
     Gear^.dY:= Gear^.dY + cGravity * 3;
     Gear^.Y:= Gear^.Y + Gear^.dY;
     CheckGearDrowning(Gear);
-    ResumeMusic;
+    if (Gear^.State and gstDrowning) <> 0 then
+        begin
+        if CurrentHedgehog^.Gear <> nil then
+            begin
+            // Drown the hedgehog.  Could also just delete it, but hey, this gets a caption
+            CurrentHedgehog^.Gear^.Active:= true;
+            CurrentHedgehog^.Gear^.X:= Gear^.X;
+            CurrentHedgehog^.Gear^.Y:=int2hwFloat(cWaterLine+cVisibleWater)+_128;
+            CurrentHedgehog^.Unplaced:= false
+            end;
+        ResumeMusic
+        end;
     exit
     end;