Merge pull request #3097 from Fraku-64/ConsoleFix

Fix console title not updating and world not saving when the last player disconnects
This commit is contained in:
Lucas Nicodemus 2025-05-07 23:14:50 +09:00 committed by GitHub
commit aa9b8ff22b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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