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
hammermaps committed Apr 24, 2023
1 parent c650bac commit c66271f
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 @@ -397,7 +397,9 @@ void CHornet::DartTouch( CBaseEntity *pOther )

void CHornet::DieTouch ( CBaseEntity *pOther )
{
if (pOther && pOther->pev->takedamage && pev->owner)
//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 c66271f

Please sign in to comment.