]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Makes`GameTicker` use `FlushEntities()` (#23299)
authorLeon Friedrich <60421075+ElectroJr@users.noreply.github.com>
Thu, 4 Jan 2024 03:33:43 +0000 (22:33 -0500)
committerGitHub <noreply@github.com>
Thu, 4 Jan 2024 03:33:43 +0000 (14:33 +1100)
Content.Server/GameTicking/GameTicker.RoundFlow.cs

index ea8c980eb39d8cb2968e4e934ca41f887fb089fe..cec0b442b053e2f0f9069883a267dedb8b86e80d 100644 (file)
@@ -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();