mirror of
https://github.com/alliedmodders/sourcemod.git
synced 2025-12-06 18:08:36 +00:00
Fix basecomm throwing errors on console native invocation...
This commit is contained in:
parent
1b3599c189
commit
7bb5bb3042
@ -34,12 +34,12 @@
|
|||||||
public int Native_IsClientGagged(Handle hPlugin, int numParams)
|
public int Native_IsClientGagged(Handle hPlugin, int numParams)
|
||||||
{
|
{
|
||||||
int client = GetNativeCell(1);
|
int client = GetNativeCell(1);
|
||||||
if (client < 1 || client > MaxClients)
|
if (!(-1 < client <= MaxClients))
|
||||||
{
|
{
|
||||||
return ThrowNativeError(SP_ERROR_NATIVE, "Invalid client index %d", client);
|
return ThrowNativeError(SP_ERROR_NATIVE, "Invalid client index %d", client);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!IsClientInGame(client))
|
if (client && !IsClientInGame(client))
|
||||||
{
|
{
|
||||||
return ThrowNativeError(SP_ERROR_NATIVE, "Client %d is not in game", client);
|
return ThrowNativeError(SP_ERROR_NATIVE, "Client %d is not in game", client);
|
||||||
}
|
}
|
||||||
@ -50,12 +50,12 @@
|
|||||||
public int Native_IsClientMuted(Handle hPlugin, int numParams)
|
public int Native_IsClientMuted(Handle hPlugin, int numParams)
|
||||||
{
|
{
|
||||||
int client = GetNativeCell(1);
|
int client = GetNativeCell(1);
|
||||||
if (client < 1 || client > MaxClients)
|
if (!(-1 < client <= MaxClients))
|
||||||
{
|
{
|
||||||
return ThrowNativeError(SP_ERROR_NATIVE, "Invalid client index %d", client);
|
return ThrowNativeError(SP_ERROR_NATIVE, "Invalid client index %d", client);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!IsClientInGame(client))
|
if (client && !IsClientInGame(client))
|
||||||
{
|
{
|
||||||
return ThrowNativeError(SP_ERROR_NATIVE, "Client %d is not in game", client);
|
return ThrowNativeError(SP_ERROR_NATIVE, "Client %d is not in game", client);
|
||||||
}
|
}
|
||||||
@ -66,12 +66,12 @@ public int Native_IsClientMuted(Handle hPlugin, int numParams)
|
|||||||
public int Native_SetClientGag(Handle hPlugin, int numParams)
|
public int Native_SetClientGag(Handle hPlugin, int numParams)
|
||||||
{
|
{
|
||||||
int client = GetNativeCell(1);
|
int client = GetNativeCell(1);
|
||||||
if (client < 1 || client > MaxClients)
|
if (!(-1 < client <= MaxClients))
|
||||||
{
|
{
|
||||||
return ThrowNativeError(SP_ERROR_NATIVE, "Invalid client index %d", client);
|
return ThrowNativeError(SP_ERROR_NATIVE, "Invalid client index %d", client);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!IsClientInGame(client))
|
if (client && !IsClientInGame(client))
|
||||||
{
|
{
|
||||||
return ThrowNativeError(SP_ERROR_NATIVE, "Client %d is not in game", client);
|
return ThrowNativeError(SP_ERROR_NATIVE, "Client %d is not in game", client);
|
||||||
}
|
}
|
||||||
@ -103,12 +103,12 @@ public int Native_SetClientGag(Handle hPlugin, int numParams)
|
|||||||
public int Native_SetClientMute(Handle hPlugin, int numParams)
|
public int Native_SetClientMute(Handle hPlugin, int numParams)
|
||||||
{
|
{
|
||||||
int client = GetNativeCell(1);
|
int client = GetNativeCell(1);
|
||||||
if (client < 1 || client > MaxClients)
|
if (!(-1 < client <= MaxClients))
|
||||||
{
|
{
|
||||||
return ThrowNativeError(SP_ERROR_NATIVE, "Invalid client index %d", client);
|
return ThrowNativeError(SP_ERROR_NATIVE, "Invalid client index %d", client);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!IsClientInGame(client))
|
if (client && !IsClientInGame(client))
|
||||||
{
|
{
|
||||||
return ThrowNativeError(SP_ERROR_NATIVE, "Client %d is not in game", client);
|
return ThrowNativeError(SP_ERROR_NATIVE, "Client %d is not in game", client);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user