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

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