alliedmodders/sourcemod — pull request #16 by psychonic (2014-05-30 21:55:30+00:00)
Title: Fix inconsistencies with OnClientDisconnected calls (bug 5988)

As reported on bug 5988, https://bugs.alliedmods.net/show_bug.cgi?id=5988
The OnClientDisconnect_Post forward and corresponding IClientListener::OnClientDisconnected function are not called for fakeclients (bots), and can also be called a bit later than OnClientDisconnect/OnClientDisconnecting (rather than instantly after) for non-bots if the disconnect is from a map change.

Attached patch unifies the logic for players/bots disconnected from a map change, having OnClientDisconnect/_Post called in sequence the same as would happen when the funcs are called from the hook on IServerGameClients::ClientDisconnect. To prevent double calls of the post forward and listener, the IsConnected guard from the pre function is copied.

@KyleSanderson thoughts?