Skip to content

Commit

Permalink
Fix ApplyMultiDamage duplicated call on MultiDamage routine (#946)
Browse files Browse the repository at this point in the history
  • Loading branch information
dystopm authored May 8, 2024
1 parent d7f22ae commit 4ecf427
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions regamedll/dlls/weapons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 4ecf427

Please sign in to comment.