Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Fix #3227, Raven OKP letting extra bombs through #5170

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions scripts/bomberprec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ function script.BlockShot(num, targetID)
--Spring.Echo(vx .. ", " .. vy .. ", " .. vz)
--Spring.Echo(dx .. ", " .. dy .. ", " .. dz)
--Spring.Echo(heading)
if targetID and GG.OverkillPrevention_CheckBlockNoFire(unitID, targetID, damage, 40, false, false, false) then

local TIMEOUT = 50 -- enough not to double-bomb a mex on flat land, empirically
if targetID and GG.OverkillPrevention_CheckBlockNoFire(unitID, targetID, damage, TIMEOUT, false, false, false) then
-- Remove attack command on blocked target, if it is followed by another attack command. This is commands queued in an area.
local cmdID, _, cmdTag, cp_1, cp_2 = Spring.GetUnitCurrentCommand(unitID)
if cmdID == CMD.ATTACK and (not cp_2) and cp_1 == targetID then
Expand Down Expand Up @@ -187,7 +189,7 @@ function script.BlockShot(num, targetID)
--return true
--end

if targetID and (not isTooFast) and GG.Script.OverkillPreventionCheck(unitID, targetID, damage, 270, 35, 0.025) then
if targetID and (not isTooFast) and GG.Script.OverkillPreventionCheck(unitID, targetID, damage, 270, TIMEOUT, 0.025) then
return true
end
GG.FakeUpright.FakeUprightTurn(unitID, xp, zp, base, predrop)
Expand Down