Extract function ZTeleClientInProgress.

This commit is contained in:
Richard Helgeby 2015-03-22 18:57:44 +01:00
parent 387f59e2cb
commit 99f0bfef7b

View File

@ -130,7 +130,7 @@ bool:ZTeleClient(client, bool:force = false)
} }
// If teleport is already in progress, then stop. // If teleport is already in progress, then stop.
if (tZTele[client] != INVALID_HANDLE) if (ZTeleClientInProgress(client))
{ {
if (!force) if (!force)
{ {
@ -438,9 +438,14 @@ public Action:ZTeleTimer(Handle:timer, any:client)
return Plugin_Continue; return Plugin_Continue;
} }
bool ZTeleClientInProgress(client)
{
return tZTele[client] != INVALID_HANDLE;
}
ZTeleStopTimer(client) ZTeleStopTimer(client)
{ {
if (tZTele[client] != INVALID_HANDLE) if (ZTeleClientInProgress(client))
{ {
KillTimer(tZTele[client]); KillTimer(tZTele[client]);
} }