Register Cargo and Upgrade types and remove old debug print

This commit is contained in:
EvilFactory
2022-10-30 19:21:15 -03:00
parent 6e4d4b0950
commit ef0bb33def
2 changed files with 17 additions and 2 deletions

View File

@@ -81,6 +81,12 @@ RegisterBarotrauma("CharacterParams+SoundParams")
RegisterBarotrauma("Item")
RegisterBarotrauma("DeconstructItem")
RegisterBarotrauma("PurchasedItem")
RegisterBarotrauma("PurchasedItemSwap")
RegisterBarotrauma("PurchasedUpgrade")
RegisterBarotrauma("SoldItem")
RegisterBarotrauma("UpgradeManager")
RegisterBarotrauma("CargoManager")
RegisterBarotrauma("FabricationRecipe")
RegisterBarotrauma("PreferredContainer")
RegisterBarotrauma("SwappableItem")

View File

@@ -42,14 +42,23 @@ if not CSActive then
LuaUserData.RegisterType = function (typeName)
local descriptor = Descriptors[typeName]
print(typeName)
if descriptor == nil then
error("Type '" .. typeName .. "' can't be registered", 2)
else
return descriptor
end
end
local originalCreateStatic = LuaUserData.CreateStatic
LuaUserData.CreateStatic = function (typeName, addCallMethod)
local descriptor = Descriptors[typeName]
if descriptor == nil then
error("Unable to create static reference to type " .. typeName, 2)
end
return originalCreateStatic(typeName, addCallMethod)
end
end
LuaSetup = nil