Fix ApplyMultiDamage duplicated call on MultiDamage routine (#946)

This commit is contained in:
Francisco Muñoz 2024-05-08 11:18:36 -04:00 committed by GitHub
parent d7f22ae3ec
commit 4ecf42799d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -106,9 +106,15 @@ void EXT_FUNC __API_HOOK(AddMultiDamage)(entvars_t *pevInflictor, CBaseEntity *p
gMultiDamage.type |= bitsDamageType; gMultiDamage.type |= bitsDamageType;
if (pEntity != gMultiDamage.pEntity) if (pEntity != gMultiDamage.pEntity)
{
#ifdef REGAMEDLL_FIXES
if (gMultiDamage.pEntity) // avoid api calls with null default pEntity
#endif
{ {
// UNDONE: wrong attacker! // UNDONE: wrong attacker!
ApplyMultiDamage(pevInflictor, pevInflictor); ApplyMultiDamage(pevInflictor, pevInflictor);
}
gMultiDamage.pEntity = pEntity; gMultiDamage.pEntity = pEntity;
gMultiDamage.amount = 0; gMultiDamage.amount = 0;
} }