Don't check handle ownership on Event.FireToClient
The handle does not get mutated here, so it is safe. Since we don't currently support cloning event handles or copying events, this also facilitates the only easy way of firing an existing game- created event to a client.
This commit is contained in:
parent
0aa11374d8
commit
cb39030cce
@ -160,12 +160,6 @@ static cell_t sm_FireEventToClient(IPluginContext *pContext, const cell_t *param
|
|||||||
return pContext->ThrowNativeError("Invalid game event handle %x (error %d)", hndl, err);
|
return pContext->ThrowNativeError("Invalid game event handle %x (error %d)", hndl, err);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If identities do not match, don't fire event */
|
|
||||||
if (pContext->GetIdentity() != pInfo->pOwner)
|
|
||||||
{
|
|
||||||
return pContext->ThrowNativeError("Game event \"%s\" could not be fired because it was not created by this plugin", pInfo->pEvent->GetName());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pInfo->bDontBroadcast)
|
if (pInfo->bDontBroadcast)
|
||||||
{
|
{
|
||||||
return pContext->ThrowNativeError("Game event \"%s\" is set to not be broadcasted to clients", pInfo->pEvent->GetName());
|
return pContext->ThrowNativeError("Game event \"%s\" is set to not be broadcasted to clients", pInfo->pEvent->GetName());
|
||||||
|
Loading…
Reference in New Issue
Block a user