# HG changeset patch # User Wuzzy # Date 1562799209 -7200 # Node ID f16376e9374f9f0491151e916e7ccbdd7d2199d3 # Parent 32678e65b25e0ee9463a43c3f6d18c7604cc37e1 Remove all placement restrictions of air attack and friends diff -r 32678e65b25e -r f16376e9374f ChangeLog.txt --- a/ChangeLog.txt Thu Jul 11 00:45:49 2019 +0200 +++ b/ChangeLog.txt Thu Jul 11 00:53:29 2019 +0200 @@ -33,7 +33,6 @@ * Fix player-chosen teams ignoring custom team controls in campaigns * Fix broken behaviour of airborne attacks when placed near bounce world edge * Fix crate sometimes collected twice when switching to hedgehog that touches it - * Deny placement of airborne attack in “impossible” places in maps with bounce world edge * Deny placement of piano beyond bounce world edge * Fix laser sight not working properly when it starts out of map bounds * Fix parachute making hog stuck or fast when bumping into wall while looking other way diff -r 32678e65b25e -r f16376e9374f hedgewars/uGearsHandlersMess.pas --- 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;