From 9f2535a130841ad2a1b0a669a5020d5c28b0be2b Mon Sep 17 00:00:00 2001 From: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com> Date: Wed, 3 Jan 2024 22:33:43 -0500 Subject: [PATCH] Makes`GameTicker` use `FlushEntities()` (#23299) --- .../GameTicking/GameTicker.RoundFlow.cs | 24 ++----------------- 1 file changed, 2 insertions(+), 22 deletions(-) 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(); -- 2.51.2