fix some hooks not getting triggered in singleplayer
This commit is contained in:
@@ -7,6 +7,7 @@ using System.Collections.Generic;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using MoonSharp.Interpreter.Interop;
|
using MoonSharp.Interpreter.Interop;
|
||||||
using static Barotrauma.LuaCsSetup;
|
using static Barotrauma.LuaCsSetup;
|
||||||
|
using System.Threading;
|
||||||
|
|
||||||
namespace Barotrauma
|
namespace Barotrauma
|
||||||
{
|
{
|
||||||
@@ -89,7 +90,7 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
result = null;
|
result = null;
|
||||||
#if CLIENT
|
#if CLIENT
|
||||||
if (GameMain.GameSession?.IsRunning == false && GameMain.IsSingleplayer)
|
if (GameMain.GameSession?.IsRunning == false && GameMain.IsSingleplayer && GameMain.MainThread != Thread.CurrentThread)
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
try
|
try
|
||||||
@@ -378,7 +379,7 @@ namespace Barotrauma
|
|||||||
public T Call<T>(string name, params object[] args)
|
public T Call<T>(string name, params object[] args)
|
||||||
{
|
{
|
||||||
#if CLIENT
|
#if CLIENT
|
||||||
if (GameMain.GameSession?.IsRunning == false && GameMain.IsSingleplayer)
|
if (GameMain.GameSession?.IsRunning == false && GameMain.IsSingleplayer && GameMain.MainThread != Thread.CurrentThread)
|
||||||
return default(T);
|
return default(T);
|
||||||
#endif
|
#endif
|
||||||
if (GameMain.LuaCs == null) return default(T);
|
if (GameMain.LuaCs == null) return default(T);
|
||||||
|
|||||||
Reference in New Issue
Block a user