Skip to content

Commit

Permalink
Fix hornets crashing the game if they hit you after a level transition
Browse files Browse the repository at this point in the history
  • Loading branch information
SamVanheer committed Feb 21, 2022
1 parent f347954 commit e7fb734
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dlls/hornet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,9 @@ void CHornet::DartTouch(CBaseEntity* pOther)

void CHornet::DieTouch(CBaseEntity* pOther)
{
if (pOther && 0 != pOther->pev->takedamage)
//Only deal damage if the owner exists in this map.
//Hornets that transition without their owner (e.g. Alien Grunt) will otherwise pass a null pointer down to TakeDamage.
if (pOther && 0 != pOther->pev->takedamage && nullptr != pev->owner)
{ // do the damage

switch (RANDOM_LONG(0, 2))
Expand Down

0 comments on commit e7fb734

Please sign in to comment.