Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zxbc committed Jun 25, 2023
1 parent 2a55fdc commit 25d5740
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cmd_single_volley_attack_mode.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function widget:GetInfo()
date = "June 22, 2023",
license = "GNU GPL, v2 or later",
version = "1.2",
layer = 9999,
layer = -10,
enabled = true,
handler = true
}
Expand Down Expand Up @@ -133,6 +133,12 @@ function SingleVolleyAttackToggle(_,_,_,args)
end

function SingleVolleyAttackCommand(_,_,_,args)
-- if somehow build options are avaiable, this is a builder and we don't want to do anything
if Spring.GetSelectedUnitsCount() == 1 then
local unitID = Spring.GetSelectedUnits()[1]
local unitDef = UnitDefs[spGetUnitDefID(unitID)]
if unitDef.buildOptions[1] then return end
end
singleVolleyAttackActive = true
spSetActiveCommand("attack", 1)
end
Expand Down

0 comments on commit 25d5740

Please sign in to comment.