Replacing table.wipe with Details:Destroy()

This commit is contained in:
Tercio Jose
2023-05-22 15:31:29 -03:00
parent fa0d1e1d08
commit 0cdfa2b900
40 changed files with 1205 additions and 1322 deletions
+19 -1
View File
@@ -371,6 +371,13 @@ end
end
end
---return the actor type which is containing on this container
---@self actorcontainer
---@return number
function actorContainer:GetType()
return self.tipo
end
---return the actor object for a given actor name
---@param actorName string
---@return table|nil
@@ -1087,7 +1094,7 @@ end
Details:UpdatePetsOnParser()
end
function Details:ClearCCPetsBlackList()
table.wipe(petBlackList)
Details:Destroy(petBlackList)
end
function actorContainer:FuncaoDeCriacao (tipo)
@@ -1144,6 +1151,17 @@ end
return self:remapear()
end
---remove an actor from the container, by removing this way, the container does not need to be remapped
---@param self actorcontainer
---@param actorObject actor
function actorContainer:RemoveActor(actorObject)
local nameMap = self._NameIndexTable
local actorList = self._ActorTable
local actorIndex = nameMap[actorObject.nome]
nameMap[actorObject.nome] = nil --actorObject.nome a nil value | Details/boot.lua"]:1374: in function `DestroyActor' | meta.lua"]:590: in function `PrepareTablesForSave' | savedata.lua"]:86
table.remove(actorList, actorIndex)
end
function actorContainer:remapear()
local namingMap = self._NameIndexTable
local actorList = self._ActorTable