From e7fb73457e1f28f42c038a0a62cfe0b9a15240db Mon Sep 17 00:00:00 2001 From: Sam V Date: Mon, 21 Feb 2022 16:28:55 +0100 Subject: [PATCH] Fix hornets crashing the game if they hit you after a level transition Resolves ValveSoftware/halflife#1598 --- dlls/hornet.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/hornet.cpp b/dlls/hornet.cpp index 7e5c33339..df1a4a7cd 100644 --- a/dlls/hornet.cpp +++ b/dlls/hornet.cpp @@ -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))