implement priority item updates, seems to work correctly after heavy testing in random servers

This commit is contained in:
Evil Factory
2022-01-02 18:57:35 -03:00
parent afd58681d7
commit fcd0b2cc6d
3 changed files with 57 additions and 28 deletions
@@ -83,7 +83,6 @@ 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,15 +259,11 @@ namespace Barotrauma
}
}
step++;
if (step % GameMain.Lua.game.mapEntityUpdateRate == 0)
{
#if CLIENT
MapEntity.UpdateAll((float)deltaTime * GameMain.Lua.game.mapEntityUpdateRate, cam);
MapEntity.UpdateAll((float)deltaTime, cam);
#elif SERVER
MapEntity.UpdateAll((float)deltaTime * GameMain.Lua.game.mapEntityUpdateRate, Camera.Instance);
MapEntity.UpdateAll((float)deltaTime, Camera.Instance);
#endif
}
#if CLIENT
sw.Stop();