From 8802dc71a56bfe87db766c6dab331046575f7eb9 Mon Sep 17 00:00:00 2001 From: terencehill Date: Sun, 27 Nov 2016 20:19:01 +0100 Subject: [PATCH] Show to spectators all the waypoints that are shown to spectated players. It fixes #1840 --- .../mutators/mutator/waypoints/waypointsprites.qc | 10 +++++----- qcsrc/common/turrets/cl_turrets.qc | 7 +++---- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc index e7a33567b..a26441ee6 100644 --- a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc +++ b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc @@ -475,13 +475,13 @@ void Draw_WaypointSprite(entity this) InterpolateOrigin_Do(this); - float t = entcs_GetTeam(player_localnum) + 1; string spriteimage = ""; // choose the sprite switch (this.rule) { case SPRITERULE_SPECTATOR: + float t = entcs_GetTeam(player_localnum) + 1; if (!( (autocvar_g_waypointsprite_itemstime == 1 && t == NUM_SPECTATOR + 1) || (autocvar_g_waypointsprite_itemstime == 2 && (t == NUM_SPECTATOR + 1 || warmup_stage || STAT(ITEMSTIME) == 2)) @@ -492,7 +492,7 @@ void Draw_WaypointSprite(entity this) case SPRITERULE_DEFAULT: if (this.team) { - if (this.team == t) + if (this.team == myteam + 1) spriteimage = this.netname; else spriteimage = ""; @@ -501,9 +501,9 @@ void Draw_WaypointSprite(entity this) spriteimage = this.netname; break; case SPRITERULE_TEAMPLAY: - if (t == NUM_SPECTATOR + 1) + if (myteam == NUM_SPECTATOR) spriteimage = this.netname3; - else if (this.team == t) + else if (this.team == myteam + 1) spriteimage = this.netname2; else spriteimage = this.netname; @@ -613,7 +613,7 @@ void Draw_WaypointSprite(entity this) float crosshairdistance = sqrt( pow(o.x - vid_conwidth/2, 2) + pow(o.y - vid_conheight/2, 2) ); - t = waypointsprite_scale; + float t = waypointsprite_scale; a *= waypointsprite_alpha; { diff --git a/qcsrc/common/turrets/cl_turrets.qc b/qcsrc/common/turrets/cl_turrets.qc index c21e327d4..48c6a8798 100644 --- a/qcsrc/common/turrets/cl_turrets.qc +++ b/qcsrc/common/turrets/cl_turrets.qc @@ -67,13 +67,12 @@ void turret_draw2d(entity this) return; float dist = vlen(this.origin - view_origin); - float t = (entcs_GetTeam(player_localnum) + 1); vector o; string txt; if(autocvar_cl_vehicles_hud_tactical) - if(dist < 10240 && t != this.team) + if(dist < 10240 && (myteam + 1 != this.team)) { // TODO: Vehicle tactical hud o = project_3d_to_2d(this.origin + '0 0 32'); @@ -121,7 +120,7 @@ void turret_draw2d(entity this) else txt = spritelookuptext(this, spriteimage); - if(time - floor(time) > 0.5 && t == this.team) + if(time - floor(time) > 0.5 && (myteam + 1 == this.team)) { if(this.helpme && time < this.helpme) { @@ -163,7 +162,7 @@ void turret_draw2d(entity this) float crosshairdistance = sqrt( pow(o.x - vid_conwidth/2, 2) + pow(o.y - vid_conheight/2, 2) ); - t = waypointsprite_scale; + float t = waypointsprite_scale; a *= waypointsprite_alpha; { -- 2.39.2