add holdable, registered explosion and hook fixes

This commit is contained in:
Evil Factory
2021-09-09 11:19:43 -03:00
parent 01eec1e9ad
commit 8d26ef859d
2 changed files with 10 additions and 1 deletions
@@ -339,6 +339,12 @@ namespace Barotrauma
return item.GetComponent<Fabricator>();
}
public static Holdable GetHoldableComponent(Item item)
{
if (item == null) return null;
return item.GetComponent<Holdable>();
}
public static void DispatchRespawnSub()
{
GameMain.Server.RespawnManager.DispatchShuttle();
@@ -602,7 +608,8 @@ namespace Barotrauma
{
try
{
lastResult = env.lua.Call(hf.function, args);
if (hf.function is Closure)
lastResult = env.lua.Call(hf.function, args);
}
catch (Exception e)
{
@@ -204,6 +204,7 @@ namespace Barotrauma
UserData.RegisterType<WifiComponent>();
UserData.RegisterType<LightComponent>();
UserData.RegisterType<CustomInterface>();
UserData.RegisterType<Holdable>();
UserData.RegisterType<Inventory>();
UserData.RegisterType<CharacterInventory>();
UserData.RegisterType<Hull>();
@@ -221,6 +222,7 @@ namespace Barotrauma
UserData.RegisterType<ContentPackage>();
UserData.RegisterType<SubmarineInfo>();
UserData.RegisterType<SubmarineBody>();
UserData.RegisterType<Explosion>();
lua = new Script(CoreModules.Preset_SoftSandbox);