Save world on last player exit; fixes #707

This commit is contained in:
Lucas Nicodemus 2015-02-25 00:09:54 -07:00
parent e18ab50453
commit 21cd90fa23

View file

@ -1022,6 +1022,12 @@ namespace TShockAPI
RememberedPos.InsertLeavePos(tsplr.Name, tsplr.IP, (int) (tsplr.X/16), (int) (tsplr.Y/16));
}
}
// The last player will leave after this hook is executed.
if (Utils.ActivePlayers() == 1)
{
SaveManager.Instance.SaveWorld();
}
}
private void OnChat(ServerChatEventArgs args)