--- a/hedgewars/uGearsHandlersMess.pas Thu Jul 11 00:45:49 2019 +0200
+++ b/hedgewars/uGearsHandlersMess.pas Thu Jul 11 00:53:29 2019 +0200
@@ -3072,25 +3072,16 @@
if (Gear^.Health > 0) and (not (Gear^.X < Gear^.dX)) and (Gear^.X < Gear^.dX + cAirPlaneSpeed) then
begin
dec(Gear^.Health);
- if (WorldEdge = weBounce) and (((Gear^.Tag = 1) and (hwRound(Gear^.X) > rightX)) or ((Gear^.Tag = -1) and (hwRound(Gear^.X) < leftX))) then
- begin
- // Don't spawn missile if it would end up inside bounce world edge of the opposite side
- PlaySound(sndVaporize);
- AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtSmoke);
- end
- else
- begin
- // Spawn missile
- case Gear^.State of
- 0: FollowGear := AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtAirBomb, 0, cBombsSpeed * Gear^.Tag, _0, 0);
- 1: FollowGear := AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtMine, 0, cBombsSpeed * Gear^.Tag, _0, 0);
- 2: FollowGear := AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtNapalmBomb, 0, cBombsSpeed * Gear^.Tag, _0, 0);
- 3: FollowGear := AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtDrill, gsttmpFlag, cBombsSpeed * Gear^.Tag, _0, Gear^.Timer + 1);
- end;
- Gear^.dX := Gear^.dX + int2hwFloat(Gear^.Damage * Gear^.Tag);
- if CheckCoordInWater(hwRound(Gear^.X), hwRound(Gear^.Y)) then
- FollowGear^.State:= FollowGear^.State or gstSubmersible;
- end;
+ // Spawn missile
+ case Gear^.State of
+ 0: FollowGear := AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtAirBomb, 0, cBombsSpeed * Gear^.Tag, _0, 0);
+ 1: FollowGear := AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtMine, 0, cBombsSpeed * Gear^.Tag, _0, 0);
+ 2: FollowGear := AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtNapalmBomb, 0, cBombsSpeed * Gear^.Tag, _0, 0);
+ 3: FollowGear := AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtDrill, gsttmpFlag, cBombsSpeed * Gear^.Tag, _0, Gear^.Timer + 1);
+ end;
+ Gear^.dX := Gear^.dX + int2hwFloat(Gear^.Damage * Gear^.Tag);
+ if CheckCoordInWater(hwRound(Gear^.X), hwRound(Gear^.Y)) then
+ FollowGear^.State:= FollowGear^.State or gstSubmersible;
StopSoundChan(Gear^.SoundChannel, 4000);
end;
@@ -3106,42 +3097,13 @@
end;
procedure doStepAirAttack(Gear: PGear);
-var valid: boolean;
- HHGear: PGear;
+var HHGear: PGear;
begin
AllInactive := false;
- valid:= true;
- // Bounce world edge restrictions ...
- if (WorldEdge = weBounce) then
- // If plane flies right, deny placement inside the right bounce side
- if (Gear^.X.QWordValue = 0) and (Gear^.Target.X > rightX) then
- valid:= false
- // If plane flies left, deny placement inside the left bounce side
- else if (Gear^.X.QWordValue <> 0) and (Gear^.Target.X < leftX) then
- valid:= false
- // Deny placement of high targets. This serves as a buffer to further
- // reduce potentially weird bouncy gear behaviour
- else if (Gear^.Target.Y < (topY - 50)) then
- valid:= false;
-
if (Gear^.Hedgehog <> nil) and (Gear^.Hedgehog^.Gear <> nil) then
HHGear:= Gear^.Hedgehog^.Gear;
- if (not valid) then
- begin
- if (HHGear <> nil) then
- begin
- HHGear^.Message := HHGear^.Message and (not gmAttack);
- HHGear^.State := HHGear^.State and (not gstAttacking);
- HHGear^.State := HHGear^.State or gstChooseTarget;
- isCursorVisible := true;
- end;
- DeleteGear(Gear);
- PlaySound(sndDenied);
- exit;
- end;
-
if (HHGear <> nil) then
PlaySoundV(sndIncoming, Gear^.Hedgehog^.Team^.voicepack);
AfterAttack;