From ad70f0bfd27b5ef73a59da110ccf04ac22098f49 Mon Sep 17 00:00:00 2001 From: TomyLobo Date: Sun, 18 Nov 2018 16:44:44 +0100 Subject: [PATCH] Fix a crash occurring when a prop explodes Example: Vanilla HL2 barrel --- mp/src/game/server/sdk/sdk_player.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mp/src/game/server/sdk/sdk_player.cpp b/mp/src/game/server/sdk/sdk_player.cpp index 1fd4a5569..b7645600c 100644 --- a/mp/src/game/server/sdk/sdk_player.cpp +++ b/mp/src/game/server/sdk/sdk_player.cpp @@ -1540,7 +1540,7 @@ int CSDKPlayer::OnTakeDamage( const CTakeDamageInfo &inputInfo ) Vector vecFacing; AngleVectors(EyeAngles(), &vecFacing); - float flDamageMultiplier = RemapValClamped((GetAbsOrigin() - pGrenade->GetAbsOrigin()).Normalized().Dot(vecFacing), -0.7, 0.7, 1.0, 0.5); + float flDamageMultiplier = RemapValClamped((GetAbsOrigin() - pInflictor->GetAbsOrigin()).Normalized().Dot(vecFacing), -0.7, 0.7, 1.0, 0.5); flDamage *= flDamageMultiplier; // award style points