From cf7be1a6af042bbf85b8b649718ed46426c4bb88 Mon Sep 17 00:00:00 2001 From: MirceaKitsune Date: Sat, 9 Jul 2011 15:25:31 +0300 Subject: [PATCH] Oops... also consider the healthsize_min and healthsize_max values for offsetting the names --- data/qcsrc/client/Main.qc | 2 ++ data/qcsrc/client/main.qh | 2 +- data/qcsrc/client/shownames.qc | 2 +- data/qcsrc/server/cl_client.qc | 2 ++ 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/data/qcsrc/client/Main.qc b/data/qcsrc/client/Main.qc index fb04060a..626a56c2 100644 --- a/data/qcsrc/client/Main.qc +++ b/data/qcsrc/client/Main.qc @@ -1058,6 +1058,8 @@ void Ent_Init() g_vore = ReadCoord(); g_balance_vore_swallow_limit = ReadCoord(); g_healthsize = ReadCoord(); + g_healthsize_min = ReadCoord(); + g_healthsize_max = ReadCoord(); armor_max = ReadCoord(); teamheal_max = ReadCoord(); diff --git a/data/qcsrc/client/main.qh b/data/qcsrc/client/main.qh index ccf46ac4..1a1dad08 100644 --- a/data/qcsrc/client/main.qh +++ b/data/qcsrc/client/main.qh @@ -168,7 +168,7 @@ float g_weaponswitchdelay; float g_vore; float g_balance_vore_swallow_limit; -float g_healthsize; +float g_healthsize, g_healthsize_min, g_healthsize_max; float armor_max; float teamheal_max; diff --git a/data/qcsrc/client/shownames.qc b/data/qcsrc/client/shownames.qc index 40daf62b..c0cd6e8f 100644 --- a/data/qcsrc/client/shownames.qc +++ b/data/qcsrc/client/shownames.qc @@ -26,7 +26,7 @@ void Draw_ShowNames(entity ent) // offset the name by player scale, decided by health if(g_healthsize) - ent.origin_z -= (g_healthsize - ent.healthvalue) * cvar("hud_shownames_offset_healthsize"); + ent.origin_z -= (g_healthsize - bound(g_healthsize_min, ent.healthvalue, g_healthsize_max)) * cvar("hud_shownames_offset_healthsize"); traceline(ent.origin, view_origin, 1, ent); diff --git a/data/qcsrc/server/cl_client.qc b/data/qcsrc/server/cl_client.qc index 39b891f2..e020cddb 100644 --- a/data/qcsrc/server/cl_client.qc +++ b/data/qcsrc/server/cl_client.qc @@ -1045,6 +1045,8 @@ float ClientInit_SendEntity(entity to, float sf) WriteCoord(MSG_ENTITY, cvar("g_vore")); WriteCoord(MSG_ENTITY, g_balance_vore_swallow_limit); WriteCoord(MSG_ENTITY, cvar("g_healthsize")); + WriteCoord(MSG_ENTITY, cvar("g_healthsize_min")); + WriteCoord(MSG_ENTITY, cvar("g_healthsize_max")); // tell the client if this server uses armor float armor_max; -- 2.39.2