Skip to content

Commit 118d6dc

Browse files
HeadlineFyren
authored andcommitted
Improve error message for EmitSound (#787)
Improve some error messages in sdktools.
1 parent 08fe840 commit 118d6dc

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

extensions/sdktools/tenatives.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ static cell_t smn_TESend(IPluginContext *pContext, const cell_t *params)
462462
{
463463
return pContext->ThrowNativeError("Client index %d is invalid", client);
464464
} else if (!pPlayer->IsInGame()) {
465-
return pContext->ThrowNativeError("Client %d is not connected", client);
465+
return pContext->ThrowNativeError("Client %d is not in game", client);
466466
}
467467
}
468468

extensions/sdktools/vsound.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ void SoundHooks::OnEmitSound(IRecipientFilter &filter, int iEntIndex, int iChann
390390
{
391391
pFunc->GetParentContext()->BlamePluginError(pFunc, "Callback-provided client index %d is invalid", client);
392392
} else if (!pPlayer->IsInGame()) {
393-
pFunc->GetParentContext()->BlamePluginError(pFunc, "Client %d is not connected", client);
393+
pFunc->GetParentContext()->BlamePluginError(pFunc, "Client %d is not in game", client);
394394
} else {
395395
continue;
396396
}
@@ -528,7 +528,7 @@ void SoundHooks::OnEmitSound2(IRecipientFilter &filter, int iEntIndex, int iChan
528528
{
529529
pFunc->GetParentContext()->BlamePluginError(pFunc, "Client index %d is invalid", client);
530530
} else if (!pPlayer->IsInGame()) {
531-
pFunc->GetParentContext()->BlamePluginError(pFunc, "Client %d is not connected", client);
531+
pFunc->GetParentContext()->BlamePluginError(pFunc, "Client %d is not in game", client);
532532
} else {
533533
continue;
534534
}
@@ -780,7 +780,7 @@ static cell_t EmitSound(IPluginContext *pContext, const cell_t *params)
780780
{
781781
return pContext->ThrowNativeError("Client index %d is invalid", client);
782782
} else if (!pPlayer->IsInGame()) {
783-
return pContext->ThrowNativeError("Client %d is not connected", client);
783+
return pContext->ThrowNativeError("Client %d is not in game", client);
784784
}
785785
}
786786

@@ -1136,7 +1136,7 @@ static cell_t EmitSoundEntry(IPluginContext *pContext, const cell_t *params)
11361136
return pContext->ThrowNativeError("Client index %d is invalid", client);
11371137
}
11381138
else if (!pPlayer->IsInGame()) {
1139-
return pContext->ThrowNativeError("Client %d is not connected", client);
1139+
return pContext->ThrowNativeError("Client %d is not in game", client);
11401140
}
11411141
}
11421142

@@ -1273,7 +1273,7 @@ static cell_t EmitSentence(IPluginContext *pContext, const cell_t *params)
12731273
{
12741274
return pContext->ThrowNativeError("Client index %d is invalid", client);
12751275
} else if (!pPlayer->IsInGame()) {
1276-
return pContext->ThrowNativeError("Client %d is not connected", client);
1276+
return pContext->ThrowNativeError("Client %d is not in game", client);
12771277
}
12781278
}
12791279

0 commit comments

Comments
 (0)