fix VDECODE_FLAG_ALLOWNOTINGAME flag (#2000)
Corrects the check for the VDECODE_FLAG_ALLOWNOTINGAME flag
This commit is contained in:
parent
4e73713fab
commit
9f3584a056
@ -396,15 +396,17 @@ DataStatus DecodeValveParam(IPluginContext *pContext,
|
||||
if (index >= 1 && index <= playerhelpers->GetMaxClients())
|
||||
{
|
||||
IGamePlayer *player = playerhelpers->GetGamePlayer(index);
|
||||
if ((data->decflags & VDECODE_FLAG_ALLOWNOTINGAME)
|
||||
&& !player->IsConnected())
|
||||
{
|
||||
|
||||
if(!player->IsConnected()) {
|
||||
pContext->ThrowNativeError("Client %d is not connected", param);
|
||||
return Data_Fail;
|
||||
} else if (!player->IsInGame()) {
|
||||
}
|
||||
|
||||
if(!(data->decflags & VDECODE_FLAG_ALLOWNOTINGAME) && !player->IsInGame()) {
|
||||
pContext->ThrowNativeError("Client %d is not in game", param);
|
||||
return Data_Fail;
|
||||
}
|
||||
|
||||
pEntity = gamehelpers->ReferenceToEntity(param);
|
||||
} else if (param == -1) {
|
||||
if (data->decflags & VDECODE_FLAG_ALLOWNULL)
|
||||
@ -441,15 +443,17 @@ DataStatus DecodeValveParam(IPluginContext *pContext,
|
||||
if (index >= 1 && index <= playerhelpers->GetMaxClients())
|
||||
{
|
||||
IGamePlayer *player = playerhelpers->GetGamePlayer(index);
|
||||
if ((data->decflags & VDECODE_FLAG_ALLOWNOTINGAME)
|
||||
&& !player->IsConnected())
|
||||
{
|
||||
|
||||
if(!player->IsConnected()) {
|
||||
pContext->ThrowNativeError("Client %d is not connected", param);
|
||||
return Data_Fail;
|
||||
} else if (!player->IsInGame()) {
|
||||
}
|
||||
|
||||
if(!(data->decflags & VDECODE_FLAG_ALLOWNOTINGAME) && !player->IsInGame()) {
|
||||
pContext->ThrowNativeError("Client %d is not in game", param);
|
||||
return Data_Fail;
|
||||
}
|
||||
|
||||
pEntity = gamehelpers->ReferenceToEntity(param);
|
||||
} else if (param == -1) {
|
||||
if (data->decflags & VDECODE_FLAG_ALLOWNULL)
|
||||
@ -493,15 +497,17 @@ DataStatus DecodeValveParam(IPluginContext *pContext,
|
||||
if (param >= 1 && param <= playerhelpers->GetMaxClients())
|
||||
{
|
||||
IGamePlayer *player = playerhelpers->GetGamePlayer(param);
|
||||
if ((data->decflags & VDECODE_FLAG_ALLOWNOTINGAME)
|
||||
&& !player->IsConnected())
|
||||
{
|
||||
|
||||
if(!player->IsConnected()) {
|
||||
pContext->ThrowNativeError("Client %d is not connected", param);
|
||||
return Data_Fail;
|
||||
} else if (!player->IsInGame()) {
|
||||
}
|
||||
|
||||
if(!(data->decflags & VDECODE_FLAG_ALLOWNOTINGAME) && !player->IsInGame()) {
|
||||
pContext->ThrowNativeError("Client %d is not in game", param);
|
||||
return Data_Fail;
|
||||
}
|
||||
|
||||
pEdict = player->GetEdict();
|
||||
} else if (param == -1) {
|
||||
if (data->decflags & VDECODE_FLAG_ALLOWNULL)
|
||||
|
Loading…
Reference in New Issue
Block a user