Fix think hook getting called twice on the client
This commit is contained in:
@@ -927,16 +927,8 @@ namespace Barotrauma
|
|||||||
|
|
||||||
SoundManager?.Update();
|
SoundManager?.Update();
|
||||||
|
|
||||||
Stopwatch luaSw = new Stopwatch();
|
|
||||||
|
|
||||||
luaSw.Start();
|
|
||||||
|
|
||||||
GameMain.LuaCs.Update();
|
GameMain.LuaCs.Update();
|
||||||
|
|
||||||
luaSw.Stop();
|
|
||||||
PerformanceCounter.AddElapsedTicks("Think Hook", luaSw.ElapsedTicks);
|
|
||||||
|
|
||||||
|
|
||||||
Timing.Accumulator -= Timing.Step;
|
Timing.Accumulator -= Timing.Step;
|
||||||
|
|
||||||
updateCount++;
|
updateCount++;
|
||||||
|
|||||||
@@ -349,7 +349,6 @@ namespace Barotrauma
|
|||||||
CoroutineManager.Update(paused: false, (float)Timing.Step);
|
CoroutineManager.Update(paused: false, (float)Timing.Step);
|
||||||
|
|
||||||
GameMain.LuaCs.Update();
|
GameMain.LuaCs.Update();
|
||||||
GameMain.LuaCs.Hook.Call("think", new object[] { });
|
|
||||||
performanceCounterTimer.Stop();
|
performanceCounterTimer.Stop();
|
||||||
if (GameMain.LuaCs.PerformanceCounter.EnablePerformanceCounter)
|
if (GameMain.LuaCs.PerformanceCounter.EnablePerformanceCounter)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -200,7 +200,16 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
Timer?.Update();
|
Timer?.Update();
|
||||||
Steam?.Update();
|
Steam?.Update();
|
||||||
|
|
||||||
|
#if CLIENT
|
||||||
|
Stopwatch luaSw = new Stopwatch();
|
||||||
|
luaSw.Start();
|
||||||
|
#endif
|
||||||
Hook?.Call("think");
|
Hook?.Call("think");
|
||||||
|
#if CLIENT
|
||||||
|
luaSw.Stop();
|
||||||
|
GameMain.PerformanceCounter.AddElapsedTicks("Think Hook", luaSw.ElapsedTicks);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Stop()
|
public void Stop()
|
||||||
|
|||||||
Reference in New Issue
Block a user