From 658e04d846f60ce35b757321d17bfcb4161f43ae Mon Sep 17 00:00:00 2001 From: = Date: Sat, 25 Oct 2025 12:25:28 -0700 Subject: [PATCH] less strict set target --- LuaRules/Gadgets/unit_target_on_the_move.lua | 3 +-- LuaUI/Widgets/unit_showallcommands_2.lua | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/LuaRules/Gadgets/unit_target_on_the_move.lua b/LuaRules/Gadgets/unit_target_on_the_move.lua index b54758d33e..aa7224ef06 100644 --- a/LuaRules/Gadgets/unit_target_on_the_move.lua +++ b/LuaRules/Gadgets/unit_target_on_the_move.lua @@ -81,8 +81,7 @@ local setTargetSpeedMult = {} for i = 1, #UnitDefs do local ud = UnitDefs[i] weaponCounts[i] = (ud.weapons and #ud.weapons) - if ((not (ud.canFly and ((ud.isBomber or ud.isBomberAirUnit) and not ud.customParams.can_set_target))) and - ud.canAttack and ud.canMove and ud.maxWeaponRange and ud.maxWeaponRange > 0) or ud.isFactory then + if (ud.maxWeaponRange and ud.maxWeaponRange > 0) or ud.isFactory then if getMovetype(ud) == 0 then waitWaitUnits[i] = true end diff --git a/LuaUI/Widgets/unit_showallcommands_2.lua b/LuaUI/Widgets/unit_showallcommands_2.lua index 1abdb8cb0a..a62c104f7d 100644 --- a/LuaUI/Widgets/unit_showallcommands_2.lua +++ b/LuaUI/Widgets/unit_showallcommands_2.lua @@ -66,8 +66,7 @@ local gaiaTeamID = Spring.GetGaiaTeamID() local setTargetUnitDefIDs = {} for i = 1, #UnitDefs do local ud = UnitDefs[i] - if ((not (ud.canFly and ((ud.isBomber or ud.isBomberAirUnit) and not ud.customParams.can_set_target))) and - ud.canAttack and ud.canMove and ud.maxWeaponRange and ud.maxWeaponRange > 0) or ud.isFactory then + if (ud.maxWeaponRange and ud.maxWeaponRange > 0) or ud.isFactory then setTargetUnitDefIDs[i] = true end end