Fixed multiple small issues with KickClient/Ex natives (bug 5120, r=fyren).
This commit is contained in:
parent
325ae5e977
commit
45f68840ed
@ -1307,17 +1307,6 @@ static cell_t KickClient(IPluginContext *pContext, const cell_t *params)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
pPlayer->MarkAsBeingKicked();
|
|
||||||
|
|
||||||
if (pPlayer->IsFakeClient())
|
|
||||||
{
|
|
||||||
char kickcmd[40];
|
|
||||||
UTIL_Format(kickcmd, sizeof(kickcmd), "kick %s\n", pPlayer->GetName());
|
|
||||||
|
|
||||||
engine->ServerCommand(kickcmd);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
g_SourceMod.SetGlobalTarget(client);
|
g_SourceMod.SetGlobalTarget(client);
|
||||||
|
|
||||||
char buffer[256];
|
char buffer[256];
|
||||||
@ -1328,6 +1317,15 @@ static cell_t KickClient(IPluginContext *pContext, const cell_t *params)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pPlayer->IsFakeClient())
|
||||||
|
{
|
||||||
|
// Kick uses the kickid command for bots. It is already delayed
|
||||||
|
// until the next frame unless someone flushes command buffer
|
||||||
|
pPlayer->Kick(buffer);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
pPlayer->MarkAsBeingKicked();
|
||||||
g_HL2.AddDelayedKick(client, pPlayer->GetUserId(), buffer);
|
g_HL2.AddDelayedKick(client, pPlayer->GetUserId(), buffer);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
@ -1347,23 +1345,6 @@ static cell_t KickClientEx(IPluginContext *pContext, const cell_t *params)
|
|||||||
return pContext->ThrowNativeError("Client %d is not connected", client);
|
return pContext->ThrowNativeError("Client %d is not connected", client);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Ignore duplicate kicks */
|
|
||||||
if (pPlayer->IsInKickQueue())
|
|
||||||
{
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
pPlayer->MarkAsBeingKicked();
|
|
||||||
|
|
||||||
if (pPlayer->IsFakeClient())
|
|
||||||
{
|
|
||||||
char kickcmd[40];
|
|
||||||
UTIL_Format(kickcmd, sizeof(kickcmd), "kick %s\n", pPlayer->GetName());
|
|
||||||
|
|
||||||
engine->ServerCommand(kickcmd);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
g_SourceMod.SetGlobalTarget(client);
|
g_SourceMod.SetGlobalTarget(client);
|
||||||
|
|
||||||
char buffer[256];
|
char buffer[256];
|
||||||
|
Loading…
Reference in New Issue
Block a user