# HG changeset patch # User Wuzzy # Date 1559487744 -7200 # Node ID 8cb1eebee4a0fcdf04c703831bae2434418837bd # Parent ba9d54d1c25d1930db755662dd4adbc37c27e230 Properly prevent using airstrike or girder in mid-air diff -r ba9d54d1c25d -r 8cb1eebee4a0 hedgewars/uIO.pas --- a/hedgewars/uIO.pas Sat Jun 01 00:27:23 2019 +0200 +++ b/hedgewars/uIO.pas Sun Jun 02 17:02:24 2019 +0200 @@ -39,7 +39,7 @@ procedure doPut(putX, putY: LongInt; fromAI: boolean); implementation -uses uConsole, uConsts, uVariables, uCommands, uUtils, uDebug, uLocale; +uses uConsole, uConsts, uVariables, uCommands, uUtils, uDebug, uLocale, uSound; const cSendEmptyPacketTime = 1000; @@ -512,6 +512,7 @@ with CurrentHedgehog^.Gear^, CurrentHedgehog^ do if (State and gstChooseTarget) <> 0 then + if ((((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_AttackInMove) <> 0) or ((State and gstMoving) = 0)) or ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_AttackingPut) = 0)) then begin if (Ammoz[CurAmmoType].Ammo.Propz and ammoprop_NoTargetAfter) <> 0 then isCursorVisible:= false; @@ -543,6 +544,8 @@ if (Ammoz[CurAmmoType].Ammo.Propz and ammoprop_AttackingPut) <> 0 then Message:= Message or (gmAttack and InputMask); end + else + PlaySound(sndDenied) else if CurrentTeam^.ExtDriven then OutError('Got /put while not being in choose target mode', false) diff -r ba9d54d1c25d -r 8cb1eebee4a0 hedgewars/uVariables.pas --- a/hedgewars/uVariables.pas Sat Jun 01 00:27:23 2019 +0200 +++ b/hedgewars/uVariables.pas Sun Jun 02 17:02:24 2019 +0200 @@ -1441,6 +1441,7 @@ ammoprop_NoCrosshair or ammoprop_NeedTarget or ammoprop_AttackingPut or + ammoprop_AttackInMove or ammoprop_Utility or ammoprop_DontHold; Count: 2;