Fix bullshit Lua issues
This commit is contained in:
+1
-1
@@ -34,7 +34,7 @@ namespace Barotrauma
|
||||
|
||||
Script.GlobalOptions.CustomConverters.SetScriptToClrCustomConversion(DataType.Function, typeof(LuaCsAction), v => (LuaCsAction)(args =>
|
||||
{
|
||||
if (v.Function.OwnerScript == _luaScriptManagementService)
|
||||
if (v.Function.OwnerScript == _luaScriptManagementService.InternalScript)
|
||||
{
|
||||
Call(v.Function, args);
|
||||
}
|
||||
|
||||
+17
-6
@@ -61,7 +61,7 @@ namespace Barotrauma
|
||||
public LuaCsTimer(IEventService eventService)
|
||||
{
|
||||
_eventService = eventService;
|
||||
_eventService.Subscribe<IEventUpdate>(this);
|
||||
SubscribeToEvents();
|
||||
}
|
||||
|
||||
private void AddTimer(TimedAction timedAction)
|
||||
@@ -101,11 +101,6 @@ namespace Barotrauma
|
||||
AddTimer(timedAction);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_eventService.Unsubscribe<IEventUpdate>(this);
|
||||
}
|
||||
|
||||
public void OnUpdate(double fixedDeltaTime)
|
||||
{
|
||||
lock (timedActions)
|
||||
@@ -135,6 +130,22 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
private void SubscribeToEvents()
|
||||
{
|
||||
_eventService.Subscribe<IEventUpdate>(this);
|
||||
}
|
||||
|
||||
public FluentResults.Result Reset()
|
||||
{
|
||||
SubscribeToEvents();
|
||||
return FluentResults.Result.Ok();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_eventService.Unsubscribe<IEventUpdate>(this);
|
||||
}
|
||||
|
||||
public bool IsDisposed => false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user