Fixed the issue 'Segment Not Found' while resetting data
- Fixed the issue 'Segment Not Found' while resetting data.
This commit is contained in:
@@ -335,6 +335,7 @@
|
||||
---@field IsLowerInstance fun(instance: instance) : boolean
|
||||
---@field IsEnabled fun(instance: instance) : boolean
|
||||
---@field GetId fun(instance: instance) : instanceid
|
||||
---@field SetSegmentId fun(instance: instance, segment: segmentid) set the segmentId for the instance and nothing else, use 'SetSegment' for a full update
|
||||
---@field GetSegmentId fun(instance: instance) : segmentid
|
||||
---@field RefreshCombat fun(instance: instance)
|
||||
---@field Freeze fun(instance: instance)
|
||||
|
||||
@@ -238,10 +238,16 @@ local instanceMixins = {
|
||||
else
|
||||
---@type combat
|
||||
local combatObject = Details:GetCombat(segmentId)
|
||||
if (combatObject.__destroyed) then
|
||||
table.remove(Details:GetCombatSegments(), segmentId)
|
||||
combatObject = combatClass:NovaTabela()
|
||||
table.insert(Details:GetCombatSegments(), segmentId, combatObject)
|
||||
if (not combatObject) then
|
||||
instance:SetSegmentId(DETAILS_SEGMENTID_CURRENT)
|
||||
instance:RefreshCombat()
|
||||
return
|
||||
else
|
||||
if (combatObject.__destroyed) then
|
||||
table.remove(Details:GetCombatSegments(), segmentId)
|
||||
combatObject = combatClass:NovaTabela()
|
||||
table.insert(Details:GetCombatSegments(), segmentId, combatObject)
|
||||
end
|
||||
end
|
||||
instance.showing = combatObject
|
||||
end
|
||||
@@ -403,6 +409,10 @@ local instanceMixins = {
|
||||
return instance.segmento
|
||||
end,
|
||||
|
||||
SetSegmentId = function(instance, segmentId)
|
||||
instance.segmento = segmentId
|
||||
end,
|
||||
|
||||
---return the mais attribute id and the sub attribute
|
||||
---@param instance instance
|
||||
---@return attributeid
|
||||
|
||||
Reference in New Issue
Block a user