]> de.git.xonotic.org Git - voretournament/voretournament.git/commitdiff
Offset the names for scaled players, to match the proper scale
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 9 Jul 2011 00:19:40 +0000 (03:19 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 9 Jul 2011 00:19:40 +0000 (03:19 +0300)
data/defaultVT.cfg
data/qcsrc/client/Main.qc
data/qcsrc/client/main.qh
data/qcsrc/client/shownames.qc
data/qcsrc/server/cl_client.qc
data/qcsrc/server/ent_cs.qc

index c16e6eb7fef823b623afdfa638fadc7978ed840f..1c906113def507c0c5af42594322506a0c65b7f0 100644 (file)
@@ -921,7 +921,7 @@ sv_curl_defaulturl "http://www.alientrap.org/voretournament/contentdownload/getm
 \r
 set sv_motd ""\r
 \r
-seta cl_shownames 2    "show player names pointed to (0: never, 1: teamplay only, 2: always)"\r
+seta cl_shownames 0    "show player names pointed to (0: never, 1: teamplay only, 2: always) (deprecated in VoreTournament)"\r
 set sv_allow_shownames 1\r
 \r
 set g_waypoints_for_items 1    "make waypoints out of items, values: 0 = never, 1 = unless the mapper prevents it by worldspawn.spawnflags & 1, 2 = always"\r
@@ -1161,6 +1161,7 @@ seta hud_shownames_maxdistance 2500 "alpha/size is 0 at this distance"
 seta hud_shownames_antioverlap 1 "if two tags get too close to each other, fade out the one further away from you"\r
 seta hud_shownames_antioverlap_distance 125 "2d distance to other tag after which to fade out"\r
 seta hud_shownames_offset 52 "offset (along z-axis) tag from player origin by this many units"\r
+seta hud_shownames_offset_healthsize 0.25 "offset (along z-axis) tag from player origin by this many units, based on player size"\r
 \r
 sbar_info_pos 50\r
 seta sbar_alpha_bg 0.8 "alpha value of the HUD background"\r
index e7fd1ea24c25a91989d580c508e2538ed44205b0..f7b08497e608a85ca1af56dcae63ead97fc968b2 100644 (file)
@@ -1057,6 +1057,7 @@ void Ent_Init()
 \r
        g_vore = ReadCoord();\r
        g_balance_vore_swallow_limit = ReadCoord();\r
+       g_healthsize = ReadCoord();\r
 \r
        armor_max = ReadCoord();\r
 \r
index eac98e3d9eef674008727965e322212b0259084c..f1e52b9441b7619edde2fa09f23b5930b5aef838 100644 (file)
@@ -168,6 +168,7 @@ float g_weaponswitchdelay;
 \r
 float g_vore;\r
 float g_balance_vore_swallow_limit;\r
+float g_healthsize;\r
 float armor_max;\r
 \r
 //hooks\r
index fac602ee0f6a0ee44d568ccfca31398c5053eeef..7dac25a5254eca2a6fbc741d023fe17b7a724c39 100644 (file)
@@ -21,6 +21,10 @@ void Draw_ShowNames(entity ent)
        {
                ent.origin_z += cvar("hud_shownames_offset");
 
+               // offset the name by player scale, decided by health
+               if(g_healthsize)
+                       ent.origin_z -= (g_healthsize - ent.healthvalue) * cvar("hud_shownames_offset_healthsize");
+
                if(!ent.sameteam)
                {
                        /* WIP, why does trace_ent != ent not work as intended here?
index 66b11a02e0b42a531d48e7bd225d4278f683f945..94f5936c99f66a1725cb1aa3769629630b232322 100644 (file)
@@ -1044,6 +1044,7 @@ float ClientInit_SendEntity(entity to, float sf)
 \r
        WriteCoord(MSG_ENTITY, cvar("g_vore"));\r
        WriteCoord(MSG_ENTITY, g_balance_vore_swallow_limit);\r
+       WriteCoord(MSG_ENTITY, cvar("g_healthsize"));\r
 \r
        // tell the client if this server uses armor\r
        float armor_max;\r
index dfb8a4066dfa3159e373ba98a5f7677a25102482..ff20effe5db672836dc4153e085984df995583cf 100644 (file)
@@ -62,7 +62,7 @@ float entcs_send(entity to, float sf)
 \r
 void entcs_think()\r
 {\r
-       self.nextthink = time + 0.01;\r
+       self.nextthink = time + 0.03;\r
 \r
        entity o;\r
        o = self.owner;\r