Oops... also consider the healthsize_min and healthsize_max values for offsetting...
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 9 Jul 2011 12:25:31 +0000 (15:25 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 9 Jul 2011 12:25:31 +0000 (15:25 +0300)
data/qcsrc/client/Main.qc
data/qcsrc/client/main.qh
data/qcsrc/client/shownames.qc
data/qcsrc/server/cl_client.qc

index fb04060..626a56c 100644 (file)
@@ -1058,6 +1058,8 @@ void Ent_Init()
        g_vore = ReadCoord();\r
        g_balance_vore_swallow_limit = ReadCoord();\r
        g_healthsize = ReadCoord();\r
+       g_healthsize_min = ReadCoord();\r
+       g_healthsize_max = ReadCoord();\r
 \r
        armor_max = ReadCoord();\r
        teamheal_max = ReadCoord();\r
index ccf46ac..1a1dad0 100644 (file)
@@ -168,7 +168,7 @@ float g_weaponswitchdelay;
 \r
 float g_vore;\r
 float g_balance_vore_swallow_limit;\r
-float g_healthsize;\r
+float g_healthsize, g_healthsize_min, g_healthsize_max;\r
 float armor_max;\r
 float teamheal_max;\r
 \r
index 40daf62..c0cd6e8 100644 (file)
@@ -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);
 
index 39b891f..e020cdd 100644 (file)
@@ -1045,6 +1045,8 @@ float ClientInit_SendEntity(entity to, float sf)
        WriteCoord(MSG_ENTITY, cvar("g_vore"));\r
        WriteCoord(MSG_ENTITY, g_balance_vore_swallow_limit);\r
        WriteCoord(MSG_ENTITY, cvar("g_healthsize"));\r
+       WriteCoord(MSG_ENTITY, cvar("g_healthsize_min"));\r
+       WriteCoord(MSG_ENTITY, cvar("g_healthsize_max"));\r
 \r
        // tell the client if this server uses armor\r
        float armor_max;\r