]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
quick implementation of shownames in the HUD. Currently networked via MSG_ONE, not...
authorFruitieX <fruitiex@gmail.com>
Sat, 2 Apr 2011 21:15:08 +0000 (00:15 +0300)
committerFruitieX <fruitiex@gmail.com>
Sat, 2 Apr 2011 21:15:08 +0000 (00:15 +0300)
17 files changed:
_hud_descriptions.cfg
hud_luminos.cfg
hud_luminos_minimal.cfg
hud_luminos_old.cfg
hud_luminos_xhair_minimal.cfg
hud_nexuiz.cfg
qcsrc/client/Defs.qc
qcsrc/client/Main.qc
qcsrc/client/autocvars.qh
qcsrc/client/hud.qc
qcsrc/client/hud.qh
qcsrc/common/constants.qh
qcsrc/common/util.qh
qcsrc/menu/classes.c
qcsrc/server/cl_player.qc
qcsrc/server/defs.qh
qcsrc/server/t_teleporters.qc

index 269b07c526ce3dc2293a7cf67e38bb2c81066359..10066e8d6cd524ad0f3bf13c090ccabe55ac3e24 100644 (file)
@@ -215,3 +215,13 @@ seta hud_panel_infomessages_bg_alpha "" "if set to something else than \"\" = ov
 seta hud_panel_infomessages_bg_border "" "if set to something else than \"\" = override default size of border around the background"
 seta hud_panel_infomessages_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
 seta hud_panel_infomessages_flip "" "1 = align the items to the right"
+
+seta hud_panel_shownames "" "enable/disable this panel
+seta hud_panel_shownames_pos "" "position of this base of the panel"
+seta hud_panel_shownames_size "" "size of this panel"
+seta hud_panel_shownames_bg "" "if set to something else than \"\" = override default background"
+seta hud_panel_shownames_bg_color "" "if set to something else than \"\" = override default panel background color"
+seta hud_panel_shownames_bg_color_team "" "override panel color with team color in team based games"
+seta hud_panel_shownames_bg_alpha "" "if set to something else than \"\" = override default panel background alpha"
+seta hud_panel_shownames_bg_border "" "if set to something else than \"\" = override default size of border around the background"
+seta hud_panel_shownames_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
index 57be0d0a7fd69fa718e1583389404ee6c8a984b5..90f18262be05d49ff7aed1ef2ec9f7ea6ab1f729 100644 (file)
@@ -20,7 +20,7 @@ seta hud_progressbar_armor_color "0 0.6 0"
 seta hud_progressbar_fuel_color "0.6 0.6 0"
 seta hud_progressbar_nexball_color "0.7 0.1 0"
 
-seta _hud_panelorder "12 9 10 5 6 14 0 7 4 11 2 1 3 8 13 "
+seta _hud_panelorder "15 12 9 10 5 6 14 0 7 4 11 2 1 3 8 13 "
 
 seta hud_configure_grid "1"
 seta hud_configure_grid_xsize "0.010000"
@@ -215,4 +215,14 @@ seta hud_panel_infomessages_bg_border ""
 seta hud_panel_infomessages_bg_padding "0"
 seta hud_panel_infomessages_flip "1"
 
+seta hud_panel_shownames 1
+seta hud_panel_shownames_pos "0.350000 0.700000"
+seta hud_panel_shownames_size "0.300000 0.050000"
+seta hud_panel_shownames_bg "0"
+seta hud_panel_shownames_bg_color ""
+seta hud_panel_shownames_bg_color_team ""
+seta hud_panel_shownames_bg_alpha ""
+seta hud_panel_shownames_bg_border ""
+seta hud_panel_shownames_bg_padding "0"
+
 menu_sync
index fef69f23fd52f73104af2e0f42558d132c931852..9303212b4d8c667724d566765ea845becd678b73 100644 (file)
@@ -20,7 +20,7 @@ seta hud_progressbar_armor_color "0 0.6 0"
 seta hud_progressbar_fuel_color "0.6 0.6 0"
 seta hud_progressbar_nexball_color "0.7 0.1 0"
 
-seta _hud_panelorder "10 3 0 14 6 9 13 4 1 2 11 12 7 5 8 "
+seta _hud_panelorder "15 10 3 0 14 6 9 13 4 1 2 11 12 7 5 8 "
 
 seta hud_configure_grid "1"
 seta hud_configure_grid_xsize "0.010000"
index ca8ea38de05476976feaf3a64b31755697d7cd44..1d84465112a737607d2ee63980cb301628fbe74a 100644 (file)
@@ -20,7 +20,7 @@ seta hud_progressbar_armor_color "0 0.6 0"
 seta hud_progressbar_fuel_color "0.6 0.6 0"
 seta hud_progressbar_nexball_color "0.7 0.1 0"
 
-seta _hud_panelorder "10 9 6 8 14 5 0 4 13 2 7 1 3 11 12 "
+seta _hud_panelorder "15 10 9 6 8 14 5 0 4 13 2 7 1 3 11 12 "
 
 seta hud_configure_grid "1"
 seta hud_configure_grid_xsize "0.010000"
index 80fe445e48cb85ecce0e558606e43ac2b74dc14e..8ba0b58b338f3d70b9893c9520865301a9e6c98f 100644 (file)
@@ -20,7 +20,7 @@ seta hud_progressbar_armor_color "0 0.6 0"
 seta hud_progressbar_fuel_color "0.6 0.6 0"
 seta hud_progressbar_nexball_color "0.7 0.1 0"
 
-seta _hud_panelorder "3 1 2 11 10 0 14 6 9 13 4 12 7 5 8 "
+seta _hud_panelorder "15 3 1 2 11 10 0 14 6 9 13 4 12 7 5 8 "
 
 seta hud_configure_grid "1"
 seta hud_configure_grid_xsize "0.010000"
index cfa50af89acb4dd8add91079c3c9cfcc7a886954..1f012d78c32d9e4eff768fbc4a591039a4cf03bf 100644 (file)
@@ -20,7 +20,7 @@ seta hud_progressbar_armor_color "0 0.6 0"
 seta hud_progressbar_fuel_color "0.6 0.6 0"
 seta hud_progressbar_nexball_color "0.7 0.1 0"
 
-seta _hud_panelorder "0 11 8 5 6 14 9 13 7 2 3 1 10 12 4 "
+seta _hud_panelorder "15 0 11 8 5 6 14 9 13 7 2 3 1 10 12 4 "
 
 seta hud_configure_grid "1"
 seta hud_configure_grid_xsize "0.01"
index b3b0569489d992798c0ea9355f3a7a5296730968..ee296aed7921fde5dc86b18dbd596adc46c55162 100644 (file)
@@ -273,3 +273,8 @@ float nex_charge_movingavg;
 float serverflags;
 
 float uid2name_dialog;
+
+string shownames_netname;
+float shownames_health;
+float shownames_armor;
+float shownames_time;
index 91ce464793bcbc0f33879a90222c2934165fdb3a..d208640326061a8b1e4f5fef9dda2f6975cac897 100644 (file)
@@ -1329,6 +1329,16 @@ void Net_WeaponComplain() {
        weapontime = time; // ping the weapon panel
 }
 
+void Net_ShowNames()
+{
+    if(shownames_netname)
+        strunzone(shownames_netname);
+    shownames_netname = strzone(ReadString());
+    shownames_health = ReadByte();
+    shownames_armor = ReadByte();
+    shownames_time = time + 0.25;
+}
+
 // CSQC_Parse_TempEntity : Handles all temporary entity network data in the CSQC layer.
 // You must ALWAYS first acquire the temporary ID, which is sent as a byte.
 // Return value should be 1 if CSQC handled the temporary entity, otherwise return 0 to have the engine process the event.
@@ -1399,6 +1409,10 @@ float CSQC_Parse_TempEntity()
                        Net_WeaponComplain();
                        bHandled = true;
                        break;
+               case TE_CSQC_SHOWNAMES:
+            Net_ShowNames();
+            bHandled = true;
+            break;
                default:
                        // No special logic for this temporary entity; return 0 so the engine can handle it
                        bHandled = false;
index e11266ce0223324944413047fc647a5d95314ea2..42528ef1d103a07a514f6e6a573292913f333a69 100644 (file)
@@ -237,6 +237,7 @@ float autocvar_hud_panel_radar_rotation;
 float autocvar_hud_panel_radar_scale;
 float autocvar_hud_panel_radar_zoommode;
 float autocvar_hud_panel_score;
+float autocvar_hud_panel_shownames;
 float autocvar_hud_panel_timer;
 float autocvar_hud_panel_timer_increment;
 float autocvar_hud_panel_vote;
index 4dfb60c2df4d040fb17aff874bcecf767902d313..d68f6322df83f4de90174ae3214f5c07d8fd0fa6 100644 (file)
@@ -5003,6 +5003,88 @@ void HUD_InfoMessages(void)
        }
 }
 
+// ShowNames (#15)
+//
+float shownames_alpha;
+void HUD_ShowNames(void)
+{
+    if(shownames_time < time && shownames_alpha == 0 && !autocvar__hud_configure)
+        return;
+
+    if(autocvar__hud_configure)
+    {
+        shownames_alpha = 1;
+    }
+    else
+    {
+        if(shownames_time < time)
+            shownames_alpha = bound(0, shownames_alpha - 2 * frametime, 1);
+        else
+            shownames_alpha = bound(0, shownames_alpha + 4 * frametime, 1);
+    }
+    
+
+       if(!autocvar_hud_panel_shownames && !autocvar__hud_configure)
+               return;
+
+       active_panel = HUD_PANEL_SHOWNAMES;
+       HUD_Panel_UpdateCvars(shownames);
+    panel_fg_alpha *= shownames_alpha;
+       vector myPos, mySize;
+       myPos = panel_pos;
+       mySize = panel_size;
+
+       HUD_Panel_DrawBg(shownames_alpha);
+       if(panel_bg_padding)
+       {
+               myPos += '1 1 0' * panel_bg_padding;
+               mySize -= '2 2 0' * panel_bg_padding;
+       }
+
+    vector iconpos, iconsize;
+    vector namepos, namesize;
+    if(mySize_x/mySize_y > 6)
+    {
+        iconpos = myPos;
+        iconsize = eX * 2 * mySize_y + eY * mySize_y;
+
+        namepos = myPos + eX * 2 * mySize_y;
+        namesize = eX * mySize_x - eX * 2 * mySize_y + eY * mySize_y;
+    }
+    else
+    {
+        iconpos = myPos + eX * 0.5 * mySize_x - eX * 0.5 * mySize_y;
+        iconsize = eX * mySize_y + eY * 0.5 * mySize_y;
+
+        namepos = myPos + eY * 0.5 * mySize_y;
+        namesize = eX * mySize_x + eY * 0.5 * mySize_y;
+    }
+
+    if(shownames_health > 0) // otherwise player is an enemy
+    {
+        // "ghost" backgrounds
+        drawpic_aspect_skin(iconpos, "health", '1 1 0' * iconsize_y, '0 0 0', panel_fg_alpha * 0.5, DRAWFLAG_NORMAL);
+        drawpic_aspect_skin(iconpos + '0.5 0 0' * iconsize_x, "armor", '1 1 0' * iconsize_y, '0 0 0', panel_fg_alpha * 0.5, DRAWFLAG_NORMAL);
+
+        drawsetcliparea(0, myPos_y + iconsize_y - iconsize_y * min(1, shownames_health/200), vid_conwidth, myPos_y + iconsize_y);
+        drawpic_aspect_skin(iconpos, "health", '1 1 0' * iconsize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+
+        drawsetcliparea(0, myPos_y + iconsize_y - iconsize_y * min(1, shownames_armor/200), vid_conwidth, myPos_y + iconsize_y);
+        drawpic_aspect_skin(iconpos + '0.5 0 0' * iconsize_x, "armor", '1 1 0' * iconsize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+        drawresetcliparea();
+    }
+    else
+    {
+        drawpic_aspect_skin(iconpos, "health_unknown", '1 1 0' * iconsize_y, '0 0 0', panel_fg_alpha, DRAWFLAG_NORMAL);
+        drawpic_aspect_skin(iconpos + '0.5 0 0' * iconsize_x, "armor_unknown", '1 1 0' * iconsize_y, '0 0 0', panel_fg_alpha, DRAWFLAG_NORMAL);
+    }
+
+    if(autocvar__hud_configure)
+        drawcolorcodedstring_aspect(namepos, "Player1234", namesize, panel_fg_alpha, DRAWFLAG_NORMAL);
+    else
+        drawcolorcodedstring_aspect(namepos, shownames_netname, namesize, panel_fg_alpha, DRAWFLAG_NORMAL);
+}
+
 /*
 ==================
 Main HUD system
@@ -5143,6 +5225,8 @@ switch (id) {\
                HUD_EngineInfo(); break;\
        case (HUD_PANEL_INFOMESSAGES):\
                 HUD_InfoMessages(); break;\
+       case (HUD_PANEL_SHOWNAMES):\
+                HUD_ShowNames(); break;\
 } ENDS_WITH_CURLY_BRACE
 
 void HUD_Main (void)
index 21e3746b560811ee3d89c7b422b8c28f5f55a1bc..d0c1b1a90e3a1f40d9fe852ced68d39569850341 100644 (file)
@@ -266,7 +266,16 @@ if(menu_enabled == 2 && active_panel == highlightedPanel) {\
        HUD_Panel_GetMenuPos()\
 } ENDS_WITH_CURLY_BRACE
 
+// FTEQCC I HATE YOU WHY DO YOU MAKE ME DO THIS??? :(
+// max macro length is 1024 characters, I must split it up :(
+
 // Update all common cvars of given panel id
+#define HUD_Panel_UpdateCvarsForId2(id) \
+switch(id) { \
+       case HUD_PANEL_INFOMESSAGES: HUD_Panel_UpdateCvars(infomessages) break; \
+       case HUD_PANEL_SHOWNAMES: HUD_Panel_UpdateCvars(shownames) break; \
+}
+
 #define HUD_Panel_UpdateCvarsForId(id) \
 switch(id) { \
        case HUD_PANEL_WEAPONS: HUD_Panel_UpdateCvars(weapons) break; \
@@ -283,8 +292,8 @@ switch(id) { \
        case HUD_PANEL_PRESSEDKEYS: HUD_Panel_UpdateCvars(pressedkeys) break; \
        case HUD_PANEL_CHAT: HUD_Panel_UpdateCvars(chat) break; \
        case HUD_PANEL_ENGINEINFO: HUD_Panel_UpdateCvars(engineinfo) break; \
-       case HUD_PANEL_INFOMESSAGES: HUD_Panel_UpdateCvars(infomessages) break; \
-}
+} \
+HUD_Panel_UpdateCvarsForId2(id)
 
 #define HUD_Panel_UpdatePosSize(name) \
 panel_pos = stov(cvar_string("hud_panel_" #name "_pos")); \
@@ -298,6 +307,12 @@ panel_bg_border_str = cvar_string("hud_panel_" #name "_bg_border"); \
 HUD_Panel_GetBorder()
 
 // Update pos and size of given panel id
+#define HUD_Panel_UpdatePosSizeForId2(id) \
+switch(id) { \
+       case HUD_PANEL_INFOMESSAGES: HUD_Panel_UpdatePosSize(infomessages)\
+       case HUD_PANEL_SHOWNAMES: HUD_Panel_UpdatePosSize(shownames)\
+}
+
 #define HUD_Panel_UpdatePosSizeForId(id) \
 switch(id) { \
        case HUD_PANEL_WEAPONS: HUD_Panel_UpdatePosSize(weapons) break;\
@@ -314,5 +329,5 @@ switch(id) { \
        case HUD_PANEL_PRESSEDKEYS: HUD_Panel_UpdatePosSize(pressedkeys) break;\
        case HUD_PANEL_CHAT: HUD_Panel_UpdatePosSize(chat) break;\
        case HUD_PANEL_ENGINEINFO: HUD_Panel_UpdatePosSize(engineinfo) break;\
-       case HUD_PANEL_INFOMESSAGES: HUD_Panel_UpdatePosSize(infomessages)\
-}
+\
+HUD_Panel_UpdatePosSizeForId2(id)
index 419ab73e8fa1b8e14d21f44afca79f7775e0936b..9ea8a5e75f294e764693f12fbb33ee2a715e9de5 100644 (file)
@@ -63,6 +63,7 @@ const float TE_CSQC_NOTIFY = 112;
 const float TE_CSQC_WEAPONCOMPLAIN = 113;
 const float TE_CSQC_NEX_SCOPE = 116;
 const float TE_CSQC_MINELAYER_MAXMINES = 117;
+const float TE_CSQC_SHOWNAMES = 118;
 
 const float RACE_NET_CHECKPOINT_HIT_QUALIFYING = 0; // byte checkpoint, short time, short recordtime, string recordholder
 const float RACE_NET_CHECKPOINT_CLEAR = 1;
@@ -643,7 +644,8 @@ float HUD_PANEL_PRESSEDKEYS = 11;
 float HUD_PANEL_CHAT           = 12;
 float HUD_PANEL_ENGINEINFO     = 13;
 float HUD_PANEL_INFOMESSAGES   = 14;
-float HUD_PANEL_NUM            = 15; // always last panel id + 1, please increment when adding a new panel
+float HUD_PANEL_SHOWNAMES      = 15;
+float HUD_PANEL_NUM            = 16; // always last panel id + 1, please increment when adding a new panel
 
 string HUD_PANELNAME_WEAPONS           = "weapons";
 string HUD_PANELNAME_AMMO              = "ammo";
@@ -660,6 +662,7 @@ string HUD_PANELNAME_PRESSEDKEYS    = "pressedkeys";
 string HUD_PANELNAME_CHAT              = "chat";
 string HUD_PANELNAME_ENGINEINFO                = "engineinfo";
 string HUD_PANELNAME_INFOMESSAGES      = "infomessages";
+string HUD_PANELNAME_SHOWNAMES         = "shownames";
 
 float HUD_MENU_ENABLE          = 0;
 
index a15855753217765d2396f6ab38f89e127a5060dc..56a24e690c78e89e34a7ad400014f1e5490d35bf 100644 (file)
@@ -219,6 +219,7 @@ float get_model_parameters(string mod, float skn); // call with string_null to c
 switch(id) {\
        case HUD_PANEL_ENGINEINFO: panel_name = HUD_PANELNAME_ENGINEINFO; break; \
        case HUD_PANEL_INFOMESSAGES: panel_name = HUD_PANELNAME_INFOMESSAGES; break; \
+       case HUD_PANEL_SHOWNAMES: panel_name = HUD_PANELNAME_SHOWNAMES; break; \
 } ENDS_WITH_CURLY_BRACE
 
 // Get name of specified panel id
index b85546569a862e7c6d163d98833bd9a168ee53be..c93fda6f9d3df872b17e09b03b717e9c29ce8cb8 100644 (file)
 #include "xonotic/dialog_hudpanel_chat.c"
 #include "xonotic/dialog_hudpanel_engineinfo.c"
 #include "xonotic/dialog_hudpanel_infomessages.c"
+#include "xonotic/dialog_hudpanel_shownames.c"
 #include "xonotic/dialog_hudpanel_weapons.c"
 #include "xonotic/slider_picmip.c"
index 035114b25f23a9e62b34885927e9269c6330e003..2945c6efb6a747b385b049b5981cdb4e65ccf222 100644 (file)
@@ -604,8 +604,6 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
                {
                        // become fully visible
                        self.alpha = 1;
-                       // clear selected player display
-                       ClearSelectedPlayer();
                        // throw a weapon
                        SpawnThrownWeapon (self.origin + (self.mins + self.maxs) * 0.5, self.switchweapon);
                }
@@ -734,64 +732,28 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
        }
 }
 
-float UpdateSelectedPlayer_countvalue(float v)
+void net_shownames(entity selected, float teammate)
 {
-       return max(0, (v - 1.0) / 0.5);
-}
-
-// returns: -2 if no hit, otherwise cos of the angle
-// uses the global v_angle
-float UpdateSelectedPlayer_canSee(entity p, float mincosangle, float maxdist)
-{
-       vector so, d;
-       float c;
-
-       if(p == self)
-               return -2;
-
-       if(p.deadflag)
-               return -2;
-
-       so = self.origin + self.view_ofs;
-       d = p.origin - so;
-
-       // misaimed?
-       if(dist_point_line(d, '0 0 0', v_forward) > maxdist)
-               return -2;
-
-       // now find the cos of the angle...
-       c = normalize(d) * v_forward;
-
-       if(c <= mincosangle)
-               return -2;
-
-       // not visible in any way? forget it
-       if(!checkpvs(so, p))
-               return -2;
-
-       traceline(so, p.origin, MOVE_NOMONSTERS, self);
-       if(trace_fraction < 1)
-               return -2;
-
-       return c;
-}
-
-void ClearSelectedPlayer()
-{
-       if(self.selected_player)
-       {
-               centerprint_expire(self, CENTERPRIO_POINT);
-               self.selected_player = world;
-               self.selected_player_display_needs_update = FALSE;
-       }
+    float teammate_health, teammate_armor;
+    if(teammate)
+    {
+        teammate_health = selected.health;
+        teammate_armor = selected.armorvalue;
+    }
+
+       WRITESPECTATABLE_MSG_ONE({
+               WriteByte(MSG_ONE, SVC_TEMPENTITY);
+               WriteByte(MSG_ONE, TE_CSQC_SHOWNAMES);
+               WriteString(MSG_ONE, playername(selected));
+        WriteByte(MSG_ONE, teammate_health);
+        WriteByte(MSG_ONE, teammate_armor);
+        });
 }
 
 void UpdateSelectedPlayer()
 {
-       entity selected;
-       float selected_score;
-       selected = world;
-       selected_score = 0.95; // 18 degrees
+    entity selected;
+    selected = world;
 
        if(!autocvar_sv_allow_shownames)
                return;
@@ -802,84 +764,29 @@ void UpdateSelectedPlayer()
        if(self.cvar_cl_shownames == 0)
                return;
 
-       if(self.cvar_cl_shownames == 1 && !teams_matter)
-               return;
-
        makevectors(self.v_angle); // sets v_forward
 
-       // 1. cursor trace is always right
-       WarpZone_crosshair_trace(self);
-       if(trace_ent && trace_ent.classname == "player" && !trace_ent.deadflag)
-       {
-               selected = trace_ent;
-       }
-       else
-       {
-               // 2. if we don't have a cursor trace, find the player which is least
-               //    mis-aimed at
-               entity p;
-               FOR_EACH_PLAYER(p)
-               {
-                       float c;
-                       c = UpdateSelectedPlayer_canSee(p, selected_score, 100); // 100 = 2.5 meters
-                       if(c >= -1)
-                       {
-                               selected = p;
-                               selected_score = c;
-                       }
-               }
-       }
+       // cursor trace
+       if(self.selected_player_display_timeout < time)
+    {
+        WarpZone_crosshair_trace(self);
+        if(trace_ent && trace_ent.classname == "player" && !trace_ent.deadflag)
+        {
+            selected = trace_ent;
+            self.last_selected_player = selected;
+            self.selected_player_display_timeout = time + 0.1; // update at 0.1s intervals
+        }
+    }
 
        if(selected)
        {
-               self.selected_player_display_timeout = time + self.cvar_scr_centertime;
-       }
-       else
-       {
-               if(time < self.selected_player_display_timeout)
-                       if(UpdateSelectedPlayer_canSee(self.selected_player, 0.7, 200) >= -1) // 5 meters, 45 degrees
-                               selected = self.selected_player;
-       }
-
-       if(selected)
-       {
-               if(selected == self.selected_player)
-               {
-                       float save;
-                       save = UpdateSelectedPlayer_countvalue(self.selected_player_count);
-                       self.selected_player_count = self.selected_player_count + frametime;
-                       if(save != UpdateSelectedPlayer_countvalue(self.selected_player_count))
-                       {
-                               string namestr, healthstr;
-                               namestr = playername(selected);
-                               if(teams_matter)
-                               {
-                                       healthstr = ftos(floor(selected.health));
-                                       if(self.team == selected.team)
-                                       {
-                                               namestr = strcat(namestr, " (", healthstr, "%)");
-                                               self.selected_player_display_needs_update = TRUE;
-                                       }
-                               }
-                               centerprint_atprio(self, CENTERPRIO_POINT, namestr);
-                       }
-               }
-               else
-               {
-                       ClearSelectedPlayer();
-                       self.selected_player = selected;
-                       self.selected_player_time = time;
-                       self.selected_player_count = 0;
-                       self.selected_player_display_needs_update = FALSE;
-               }
-       }
-       else
-       {
-               ClearSelectedPlayer();
-       }
-
-       if(self.selected_player)
-               self.last_selected_player = self.selected_player;
+        msg_entity = self;
+        if(teams_matter)
+            if(self.team == selected.team)
+                net_shownames(selected, 1);
+        else
+            net_shownames(selected, 0);
+    }
 }
 
 .float muted; // to be used by prvm_edictset server playernumber muted 1
index d7179fafebb703f9c8b2d38ebd426d25cb2a3014..47f4a4aea3c6038b6c4e2aeea582e2c8c35d3bb0 100644 (file)
@@ -363,12 +363,7 @@ float W_WeaponBit(float wpn);
 string W_Name(float weaponid);
 
 void UpdateSelectedPlayer();
-void ClearSelectedPlayer();
-.entity selected_player;
 .entity last_selected_player;
-.float selected_player_time; // when this player has been selected
-.float selected_player_count; // how long this player has been directly pointed to
-.float selected_player_display_needs_update; // are regular updates necessary? (health)
 .float selected_player_display_timeout; // when the selection will time out
 
 void FixIntermissionClient(entity e);
index 93ced82670b1a36fb15c42a8236419621d52513a..2e64eadd77f6517e29b5ea873067082962c8ecab 100644 (file)
@@ -77,7 +77,6 @@ void spawn_tdeath(vector v0, entity e, vector v)
 #define TELEPORT_FLAGS_TELEPORTER (TELEPORT_FLAG_SOUND | TELEPORT_FLAG_PARTICLES | TELEPORT_FLAG_TDEATH)
 void TeleportPlayer(entity teleporter, entity player, vector to, vector to_angles, vector to_velocity, vector telefragmin, vector telefragmax, float tflags)
 {
-       entity oldself;
        entity telefragger;
        vector from;
 
@@ -136,14 +135,6 @@ void TeleportPlayer(entity teleporter, entity player, vector to, vector to_angle
                }
 
                player.lastteleporttime = time;
-
-               // stop player name display
-               {
-                       oldself = self;
-                       self = player;
-                       ClearSelectedPlayer();
-                       self = oldself;
-               }
        }
 }