From 0b829b2f2b5850e2cd862e45000f9e2e867bdfc2 Mon Sep 17 00:00:00 2001 From: benev0 Date: Mon, 21 Oct 2024 13:36:06 -0400 Subject: [PATCH] player count changes correctly on disconnect --- Robust.Server/Player/PlayerManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Robust.Server/Player/PlayerManager.cs b/Robust.Server/Player/PlayerManager.cs index c9f11c70edf..823706bce36 100644 --- a/Robust.Server/Player/PlayerManager.cs +++ b/Robust.Server/Player/PlayerManager.cs @@ -103,6 +103,7 @@ internal void EndSession(NetUserId user) if (!TryGetSessionById(user, out var session)) return; + RemoveSession(session.UserId); SetStatus(session, SessionStatus.Disconnected); SetAttachedEntity(session, null, out _, true); @@ -112,7 +113,6 @@ internal void EndSession(NetUserId user) viewSys.RemoveViewSubscriber(eye, session); } - RemoveSession(session.UserId); PlayerCountMetric.Set(PlayerCount); Dirty(); }