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
@@ -81,6 +81,12 @@ RegisterBarotrauma("CharacterParams+SoundParams")
RegisterBarotrauma("Item") RegisterBarotrauma("Item")
RegisterBarotrauma("DeconstructItem") RegisterBarotrauma("DeconstructItem")
RegisterBarotrauma("PurchasedItem")
RegisterBarotrauma("PurchasedItemSwap")
RegisterBarotrauma("PurchasedUpgrade")
RegisterBarotrauma("SoldItem")
RegisterBarotrauma("UpgradeManager")
RegisterBarotrauma("CargoManager")
RegisterBarotrauma("FabricationRecipe") RegisterBarotrauma("FabricationRecipe")
RegisterBarotrauma("PreferredContainer") RegisterBarotrauma("PreferredContainer")
RegisterBarotrauma("SwappableItem") RegisterBarotrauma("SwappableItem")
+11 -2
View File
@@ -42,14 +42,23 @@ if not CSActive then
LuaUserData.RegisterType = function (typeName) LuaUserData.RegisterType = function (typeName)
local descriptor = Descriptors[typeName] local descriptor = Descriptors[typeName]
print(typeName)
if descriptor == nil then if descriptor == nil then
error("Type '" .. typeName .. "' can't be registered", 2) error("Type '" .. typeName .. "' can't be registered", 2)
else else
return descriptor return descriptor
end end
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 end
LuaSetup = nil LuaSetup = nil