From 25d5740f87dcd36f791da6603f4090da7acacb17 Mon Sep 17 00:00:00 2001 From: Errrrrrr Date: Sun, 25 Jun 2023 19:40:27 +0200 Subject: [PATCH] Bug fix --- cmd_single_volley_attack_mode.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmd_single_volley_attack_mode.lua b/cmd_single_volley_attack_mode.lua index 536aa62..856d02f 100644 --- a/cmd_single_volley_attack_mode.lua +++ b/cmd_single_volley_attack_mode.lua @@ -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 } @@ -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