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
@@ -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();