Skip to content

Commit

Permalink
MakesGameTicker use FlushEntities() (space-wizards#23299)
Browse files Browse the repository at this point in the history
  • Loading branch information
ElectroJr authored Jan 4, 2024
1 parent 0fd68b2 commit 9f2535a
Showing 1 changed file with 2 additions and 22 deletions.
24 changes: 2 additions & 22 deletions Content.Server/GameTicking/GameTicker.RoundFlow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -503,29 +503,9 @@ private void ResettingCleanup()
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();

Expand Down

0 comments on commit 9f2535a

Please sign in to comment.