Fix console title not updating and world not saving when the last player disconnects

This commit is contained in:
BuildTools 2025-05-07 15:25:49 +02:00
parent a01d59209d
commit bd2aafe01a

View file

@ -1469,8 +1469,8 @@ namespace TShockAPI
Hooks.PlayerHooks.OnPlayerLogout(tsplr); Hooks.PlayerHooks.OnPlayerLogout(tsplr);
} }
// The last player will leave after this hook is executed. // If this is the last player online, update the console title and save the world if needed
if (Utils.GetActivePlayerCount() == 1) if (Utils.GetActivePlayerCount() == 0)
{ {
if (Config.Settings.SaveWorldOnLastPlayerExit) if (Config.Settings.SaveWorldOnLastPlayerExit)
SaveManager.Instance.SaveWorld(); SaveManager.Instance.SaveWorld();