From 88f9a3507cbea0124d92f8289fa94d2422e0d870 Mon Sep 17 00:00:00 2001
From: neon <>
Date: Thu, 24 Oct 2019 14:19:40 +0200
Subject: [PATCH] Hitmarker: check if health != 0

---
 Hitmarker/scripting/Hitmarker.sp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/Hitmarker/scripting/Hitmarker.sp b/Hitmarker/scripting/Hitmarker.sp
index b1fd747f..c06a90d0 100644
--- a/Hitmarker/scripting/Hitmarker.sp
+++ b/Hitmarker/scripting/Hitmarker.sp
@@ -43,7 +43,7 @@ public Plugin myinfo =
 	name         = "Hitmarker",
 	author       = "Neon & Nano",
 	description  = "Players can enable or disable their hitmarkers while shooting zombies or bosses",
-	version      = "3.0.0",
+	version      = "3.0.1",
 };
 
 //----------------------------------------------------------------------------------------------------
@@ -450,6 +450,10 @@ public void OnBossDamaged(CBoss Boss, CConfig Config, int client, float damage)
 //----------------------------------------------------------------------------------------------------
 public MRESReturn Detour_OnTakeDamage(int entity, Handle hReturn, Handle hParams)
 {
+	int iHealth = GetEntProp(entity, Prop_Data, "m_iHealth");
+	if (!iHealth)
+		return MRES_Ignored;
+
 	int client = DHookGetParamObjectPtrVar(hParams, 1, 3*(3*4) + 0, ObjectValueType_Ehandle);
 	//https://github.com/alliedmodders/hl2sdk/blob/css/game/shared/takedamageinfo.h#L115
 	//float dmg = DHookGetParamObjectPtrVar(hParams, 1, 48, ObjectValueType_Float);