# HG changeset patch # User unc0rr # Date 1210255604 0 # Node ID acab672fb1aa9dd2c0118db6c934a65526275203 # Parent b709fe13ed69c122b468c2b98fdb360d1febbc66 Fix collecting cases after teleportation diff -r b709fe13ed69 -r acab672fb1aa hedgewars/GSHandlers.inc --- a/hedgewars/GSHandlers.inc Thu May 08 13:55:14 2008 +0000 +++ b/hedgewars/GSHandlers.inc Thu May 08 14:06:44 2008 +0000 @@ -1188,6 +1188,19 @@ //////////////////////////////////////////////////////////////////////////////// procedure doStepTeleportAfter(Gear: PGear); +var HHGear: PGear; +begin +HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; +HHGear^.Y:= HHGear^.Y + HHGear^.dY; // hedgehog falling to collect cases +HHGear^.dY:= HHGear^.dY + cGravity; +if TestCollisionYwithGear(HHGear, 1) then + begin + DeleteGear(Gear); + AfterAttack + end +end; + +procedure doStepTeleportAnim(Gear: PGear); begin inc(Gear^.Timer); if Gear^.Timer = 65 then @@ -1195,10 +1208,7 @@ Gear^.Timer:= 0; inc(Gear^.Pos); if Gear^.Pos = 11 then - begin - DeleteGear(Gear); - AfterAttack - end + Gear^.doStep:= @doStepTeleportAfter end end; @@ -1221,7 +1231,7 @@ else begin DeleteCI(HHGear); SetAllHHToActive; - Gear^.doStep:= @doStepTeleportAfter; + Gear^.doStep:= @doStepTeleportAnim; Gear^.X:= HHGear^.X; Gear^.Y:= HHGear^.Y; HHGear^.X:= int2hwFloat(TargetPoint.X);