From: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com> Date: Thu, 4 Jan 2024 03:33:43 +0000 (-0500) Subject: Makes`GameTicker` use `FlushEntities()` (#23299) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=9f2535a130841ad2a1b0a669a5020d5c28b0be2b;p=space-station-14.git Makes`GameTicker` use `FlushEntities()` (#23299) --- diff --git a/Content.Server/GameTicking/GameTicker.RoundFlow.cs b/Content.Server/GameTicking/GameTicker.RoundFlow.cs index ea8c980eb3..cec0b442b0 100644 --- a/Content.Server/GameTicking/GameTicker.RoundFlow.cs +++ b/Content.Server/GameTicking/GameTicker.RoundFlow.cs @@ -503,29 +503,9 @@ namespace Content.Server.GameTicking RaiseLocalEvent(ev); // So clients' entity systems can clean up too... - RaiseNetworkEvent(ev, Filter.Broadcast()); + RaiseNetworkEvent(ev); - // Delete all entities. - foreach (var entity in EntityManager.GetEntities().ToArray()) - { -#if EXCEPTION_TOLERANCE - try - { -#endif - // TODO: Maybe something less naive here? - // FIXME: Actually, definitely. - if (!Deleted(entity) && !Terminating(entity)) - EntityManager.DeleteEntity(entity); -#if EXCEPTION_TOLERANCE - } - catch (Exception e) - { - _sawmill.Error($"Caught exception while trying to delete entity {ToPrettyString(entity)}, this might corrupt the game state..."); - _runtimeLog.LogException(e, nameof(GameTicker)); - continue; - } -#endif - } + EntityManager.FlushEntities(); _mapManager.Restart();