teleport hack fixes:
* don't let hogs fall into other hogs, barrels or other gears
* stop animation on damage (doesn't work with invul, sadly)
* don't force waiting for ground-contact in inf attack mode
* fix initially placing hog right next to instant-mine causing bugs
--- a/hedgewars/GSHandlers.inc Mon Sep 03 13:52:35 2012 -0400
+++ b/hedgewars/GSHandlers.inc Mon Sep 03 20:04:42 2012 +0200
@@ -2267,14 +2267,13 @@
var
HHGear: PGear;
begin
- Gear^.Hedgehog^.Unplaced := false;
HHGear := Gear^.Hedgehog^.Gear;
- HHGear^.Y := HHGear^.Y + HHGear^.dY;
- HHGear^.X := HHGear^.X + HHGear^.dX;
- // hedgehog falling to collect cases
- HHGear^.dY := HHGear^.dY + cGravity;
- if (TestCollisionYwithGear(HHGear, 1) <> 0)
- or CheckGearDrowning(HHGear) then
+ doStepHedgehogMoving(HHGear);
+ // if not infattack mode wait for hedgehog finish falling to collect cases
+ if ((GameFlags and gfInfAttack) <> 0)
+ or ((HHGear^.State and gstMoving) = 0)
+ or (Gear^.Hedgehog^.Gear^.Damage > 0)
+ or ((HHGear^.State and gstDrowning) = 1) then
begin
DeleteGear(Gear);
AfterAttack
@@ -2283,6 +2282,11 @@
procedure doStepTeleportAnim(Gear: PGear);
begin
+ if (Gear^.Hedgehog^.Gear^.Damage > 0) then
+ begin
+ DeleteGear(Gear);
+ AfterAttack;
+ end;
inc(Gear^.Timer);
if Gear^.Timer = 65 then
begin
@@ -2326,6 +2330,8 @@
HHGear^.X := int2hwFloat(Gear^.Target.X);
HHGear^.Y := int2hwFloat(Gear^.Target.Y);
HHGear^.State := HHGear^.State or gstMoving;
+ Gear^.Hedgehog^.Unplaced := false;
+ isCursorVisible := false;
playSound(sndWarp)
end;
Gear^.Target.X:= NoPointX