]> git.xonotic.org Git - voretournament/voretournament.git/commitdiff
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 fb04060acd7b175d8fcf3a77d7e3d17d3387ffcc..626a56c27b692c0315e7ea7b88b178d52e25faf4 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 ccf46ac47969b3ba965196b04cc241015e271be9..1a1dad0824cbdf07c2ab94aeeeb844db2ecbdba5 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 40daf62b652f9f5fc7fe49a47d982e63df240888..c0cd6e8fd309003cfb6079eabafe1a5509494b38 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 39b891f21c988093330bee13a71a107d898d4d76..e020cddbd9cf6e7afc491f980d16facff6404215 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