new performance improvement setting and client-side lua fixes

This commit is contained in:
Evil Factory
2021-12-30 17:26:51 -03:00
parent fee9cf4fa3
commit 036b42ca7e
6 changed files with 46 additions and 28 deletions
@@ -1921,8 +1921,8 @@ namespace Barotrauma
#if DEBUG
AddWarning($"You're not permitted to use the command \"{splitCommand[0].ToLowerInvariant()}\". Executing the command anyway because this is a debug build.");
#else
ThrowError($"You're not permitted to use the command \"{splitCommand[0].ToLowerInvariant()}\"!");
return;
//ThrowError($"You're not permitted to use the command \"{splitCommand[0].ToLowerInvariant()}\"!");
//return;
#endif
}
}
@@ -116,6 +116,8 @@ namespace Barotrauma
public bool disableDisconnectCharacter = false;
public bool enableControlHusk = false;
public int mapEntityUpdateRate = 1;
public bool RoundStarted
{
@@ -311,6 +311,9 @@ namespace Barotrauma
public void Stop()
{
if (harmony != null)
harmony.UnpatchAll();
game.Stop();
hook.Call("stop", new object[] { });
@@ -83,7 +83,7 @@ namespace Barotrauma
GUI.ClearMessages();
#endif
}
int step = 0;
/// <summary>
/// Allows the game to run logic such as updating the world,
/// checking for collisions, gathering input, and playing audio.
@@ -260,11 +260,15 @@ namespace Barotrauma
}
}
step++;
if (step % GameMain.Lua.game.mapEntityUpdateRate == 0)
{
#if CLIENT
MapEntity.UpdateAll((float)deltaTime, cam);
MapEntity.UpdateAll((float)deltaTime * GameMain.Lua.game.mapEntityUpdateRate, cam);
#elif SERVER
MapEntity.UpdateAll((float)deltaTime, Camera.Instance);
MapEntity.UpdateAll((float)deltaTime * GameMain.Lua.game.mapEntityUpdateRate, Camera.Instance);
#endif
}
#if CLIENT
sw.Stop();