Skip to content

Commit 4ecf427

Browse files
authored
Fix ApplyMultiDamage duplicated call on MultiDamage routine (rehlds#946)
1 parent d7f22ae commit 4ecf427

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

regamedll/dlls/weapons.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,14 @@ void EXT_FUNC __API_HOOK(AddMultiDamage)(entvars_t *pevInflictor, CBaseEntity *p
107107

108108
if (pEntity != gMultiDamage.pEntity)
109109
{
110-
// UNDONE: wrong attacker!
111-
ApplyMultiDamage(pevInflictor, pevInflictor);
110+
#ifdef REGAMEDLL_FIXES
111+
if (gMultiDamage.pEntity) // avoid api calls with null default pEntity
112+
#endif
113+
{
114+
// UNDONE: wrong attacker!
115+
ApplyMultiDamage(pevInflictor, pevInflictor);
116+
}
117+
112118
gMultiDamage.pEntity = pEntity;
113119
gMultiDamage.amount = 0;
114120
}

0 commit comments

Comments
 (0)