Call OnPlayerLogout when a player leaves the server

Fixes #902
This commit is contained in:
Lucas Nicodemus 2015-04-16 23:41:24 -06:00
parent 20d24a53c8
commit be19c3998b

View file

@ -1004,6 +1004,7 @@ namespace TShockAPI
private void OnLeave(LeaveEventArgs args) private void OnLeave(LeaveEventArgs args)
{ {
var tsplr = Players[args.Who]; var tsplr = Players[args.Who];
Hooks.PlayerHooks.OnPlayerLogout(tsplr);
Players[args.Who] = null; Players[args.Who] = null;
if (tsplr != null && tsplr.ReceivedInfo) if (tsplr != null && tsplr.ReceivedInfo)
@ -1028,7 +1029,7 @@ namespace TShockAPI
tsplr.tempGroupTimer.Stop(); tsplr.tempGroupTimer.Stop();
} }
} }
// The last player will leave after this hook is executed. // The last player will leave after this hook is executed.
if (Utils.ActivePlayers() == 1) if (Utils.ActivePlayers() == 1)
{ {