Hitmarker: check if health != 0

This commit is contained in:
neon 2019-10-24 14:19:40 +02:00
parent be1d9b84b5
commit f0d6326c39

View File

@ -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);