Allow -1/null for attacker and inflictor for OTD (bug 6494).
This commit is contained in:
parent
08fe840bfd
commit
9b8d28de56
@ -1122,13 +1122,13 @@ int SDKHooks::HandleOnTakeDamageHook(CTakeDamageInfoHack &info, SDKHookType hook
|
||||
if (ret == Pl_Changed)
|
||||
{
|
||||
CBaseEntity *pEntAttacker = gamehelpers->ReferenceToEntity(attacker);
|
||||
if (!pEntAttacker)
|
||||
if (!pEntAttacker && attacker != -1)
|
||||
{
|
||||
callback->GetParentContext()->BlamePluginError(callback, "Callback-provided entity %d for attacker is invalid", attacker);
|
||||
RETURN_META_VALUE(MRES_IGNORED, 0);
|
||||
}
|
||||
CBaseEntity *pEntInflictor = gamehelpers->ReferenceToEntity(inflictor);
|
||||
if (!pEntInflictor)
|
||||
if (!pEntInflictor && inflictor != -1)
|
||||
{
|
||||
callback->GetParentContext()->BlamePluginError(callback, "Callback-provided entity %d for inflictor is invalid", inflictor);
|
||||
RETURN_META_VALUE(MRES_IGNORED, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user