Fixed huge data-inconsistency issues when using legacy EID API features
This commit is contained in:
1 parent
d2ecc50c56
commit
71b19d9f75
1 file changed
+19
-10
+19
-10
@@ -2,22 +2,39 @@
|
|||||||
if not __eidItemDescriptions then
|
if not __eidItemDescriptions then
|
||||||
__eidItemDescriptions = {}
|
__eidItemDescriptions = {}
|
||||||
end
|
end
|
||||||
|
setmetatable(__eidItemDescriptions,
|
||||||
|
{ __newindex = function(_, k, v) EID:addCollectible(k, v) end })
|
||||||
if not __eidTrinketDescriptions then
|
if not __eidTrinketDescriptions then
|
||||||
__eidTrinketDescriptions = {}
|
__eidTrinketDescriptions = {}
|
||||||
end
|
end
|
||||||
|
setmetatable(__eidTrinketDescriptions,
|
||||||
|
{ __newindex = function(_, k, v) EID:addTrinket(k, v) end })
|
||||||
if not __eidCardDescriptions then
|
if not __eidCardDescriptions then
|
||||||
__eidCardDescriptions = {}
|
__eidCardDescriptions = {}
|
||||||
end
|
end
|
||||||
|
setmetatable(__eidCardDescriptions,
|
||||||
|
{ __newindex = function(_, k, v) EID:addCard(k, v) end })
|
||||||
if not __eidPillDescriptions then
|
if not __eidPillDescriptions then
|
||||||
__eidPillDescriptions = {}
|
__eidPillDescriptions = {}
|
||||||
end
|
end
|
||||||
|
setmetatable(__eidPillDescriptions,
|
||||||
|
{ __newindex = function(_, k, v) EID:addPill(k, v) end })
|
||||||
if not __eidItemTransformations then
|
if not __eidItemTransformations then
|
||||||
__eidItemTransformations = {}
|
__eidItemTransformations = {}
|
||||||
end
|
end
|
||||||
|
setmetatable(__eidItemTransformations,
|
||||||
|
{ __newindex = function(_, k, v) EID:assignTransformation("collectible", k, v) end })
|
||||||
if not __eidEntityDescriptions then
|
if not __eidEntityDescriptions then
|
||||||
__eidEntityDescriptions = {}
|
__eidEntityDescriptions = {}
|
||||||
end
|
end
|
||||||
|
setmetatable(__eidEntityDescriptions,
|
||||||
|
{ __newindex = function(_, k, v)
|
||||||
|
local entityID = {}
|
||||||
|
for id in string.gmatch(k, "([^.]+)") do
|
||||||
|
table.insert(entityID, id)
|
||||||
|
end
|
||||||
|
EID:addEntity(entityID[1], entityID[2], entityID[3], v[1], v[2])
|
||||||
|
end })
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
-------------------------Handle API Functions -----------------------------
|
-------------------------Handle API Functions -----------------------------
|
||||||
local nullVector = Vector(0,0)
|
local nullVector = Vector(0,0)
|
||||||
@@ -149,7 +166,6 @@ end
|
|||||||
-- Try to automatically assign vanilla transformations to the entity
|
-- Try to automatically assign vanilla transformations to the entity
|
||||||
function EID:tryAutodetectTransformationsCollectible(collectibleID)
|
function EID:tryAutodetectTransformationsCollectible(collectibleID)
|
||||||
if not REPENTANCE then return end
|
if not REPENTANCE then return end
|
||||||
|
|
||||||
local config = EID.itemConfig:GetCollectible(collectibleID)
|
local config = EID.itemConfig:GetCollectible(collectibleID)
|
||||||
local transformations = {}
|
local transformations = {}
|
||||||
transformations[EID.TRANSFORMATION.ANGEL] = config:HasTags(ItemConfig.TAG_ANGEL) or nil
|
transformations[EID.TRANSFORMATION.ANGEL] = config:HasTags(ItemConfig.TAG_ANGEL) or nil
|
||||||
@@ -165,15 +181,8 @@ function EID:tryAutodetectTransformationsCollectible(collectibleID)
|
|||||||
transformations[EID.TRANSFORMATION.SPIDERBABY] = config:HasTags(ItemConfig.TAG_SPIDER) or nil
|
transformations[EID.TRANSFORMATION.SPIDERBABY] = config:HasTags(ItemConfig.TAG_SPIDER) or nil
|
||||||
transformations[EID.TRANSFORMATION.SPUN] = config:HasTags(ItemConfig.TAG_SYRINGE) or nil
|
transformations[EID.TRANSFORMATION.SPUN] = config:HasTags(ItemConfig.TAG_SYRINGE) or nil
|
||||||
-- these dont have a tag : ADULT, STOMPY, SUPERBUM
|
-- these dont have a tag : ADULT, STOMPY, SUPERBUM
|
||||||
local transformString = ""
|
|
||||||
for k, _ in pairs(transformations) do
|
for k, _ in pairs(transformations) do
|
||||||
transformString = transformString .. k .. ","
|
EID:assignTransformation("collectible", collectibleID, k)
|
||||||
end
|
|
||||||
if string.sub(transformString, -1, -1) == "," then
|
|
||||||
transformString = string.sub(transformString, 1, -2)
|
|
||||||
end
|
|
||||||
if transformString ~= "" then
|
|
||||||
EID:assignTransformation("collectible", collectibleID, transformString)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user