Skip to content
Open
Show file tree
Hide file tree
Changes from 6 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
1 change: 1 addition & 0 deletions changelog/snippets/fix.7284.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Fix error when issuing an assist order to a mobile shield/deceiver with a destroyed unit in the selection (#7284). This should fix mobile shields sometimes stopping in range of enemies while assisting another unit, instead of continuing to move.
3 changes: 2 additions & 1 deletion lua/SimCallbacks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,8 @@ Callbacks.FlagShield = function(data, units)
local target = GetEntityById(data.target)
if units and target then
for k, u in units do
if IsEntity(u) and u.PointerEnabled == true then
if not IsDestroyed(u) and u.PointerEnabled == true then
---@cast u UAL0307 | UEL0307 | URL0306 | XSL0307
u.PointerEnabled = false --turn the pointer flag off
u:DisablePointer() --turn the pointer off
end
Expand Down
6 changes: 4 additions & 2 deletions units/UAL0307/UAL0307_script.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ UAL0307 = ClassUnit(AShieldHoverLandUnit, ShieldEffectsComponent) {
end,

DisablePointer = function(self)
self.TargetPointer:SetFireTargetLayerCaps('None') --this disables the stop feature - note that its reset on layer change!
self.PointerRestartThread = self.Trash:Add(ForkThread(self.PointerRestart,self))
if not IsDestroyed(self.TargetPointer) then
self.TargetPointer:SetFireTargetLayerCaps('None') --this disables the stop feature - note that its reset on layer change!
self.PointerRestartThread = self.Trash:Add(ForkThread(self.PointerRestart,self))
end
end,

PointerRestart = function(self)
Expand Down
6 changes: 4 additions & 2 deletions units/UEL0307/UEL0307_script.lua
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,10 @@ UEL0307 = ClassUnit(TShieldLandUnit, ShieldEffectsComponent) {
end,

DisablePointer = function(self)
self.TargetPointer:SetFireTargetLayerCaps('None') --this disables the stop feature - note that its reset on layer change!
self.PointerRestartThread = self:ForkThread(self.PointerRestart)
if not IsDestroyed(self.TargetPointer) then
self.TargetPointer:SetFireTargetLayerCaps('None') --this disables the stop feature - note that its reset on layer change!
self.PointerRestartThread = self:ForkThread(self.PointerRestart)
end
end,

PointerRestart = function(self)
Expand Down
10 changes: 6 additions & 4 deletions units/URL0306/URL0306_Script.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,12 @@ URL0306 = ClassUnit(CLandUnit) {
end,

DisablePointer = function(self)
self.TargetPointer:SetFireTargetLayerCaps('None') --this disables the stop feature - note that its reset on layer change!
local thread = ForkThread(self.PointerRestart,self)
self.Trash:Add(thread)
self.PointerRestartThread = thread
if not IsDestroyed(self.TargetPointer) then
self.TargetPointer:SetFireTargetLayerCaps('None') --this disables the stop feature - note that its reset on layer change!
local thread = ForkThread(self.PointerRestart,self)
self.Trash:Add(thread)
self.PointerRestartThread = thread
end
Comment thread
coderabbitai[bot] marked this conversation as resolved.
end,

PointerRestart = function(self)
Expand Down
10 changes: 6 additions & 4 deletions units/XSL0307/XSL0307_script.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,13 @@ XSL0307 = ClassUnit(SShieldHoverLandUnit, ShieldEffectsComponent) {

---@param self XSL0307
DisablePointer = function(self)
self.TargetPointer:SetFireTargetLayerCaps('None')
if not IsDestroyed(self.TargetPointer) then
self.TargetPointer:SetFireTargetLayerCaps('None')

local thread = ForkThread(self.PointerRestart, self)
self.Trash:Add(thread)
self.PointerRestartThread = thread
local thread = ForkThread(self.PointerRestart, self)
self.Trash:Add(thread)
self.PointerRestartThread = thread
end
end,

---@param self XSL0307
Expand Down