From 573a45ee4af6014b2465242cbf884453d371b5da Mon Sep 17 00:00:00 2001 From: terencehill Date: Sun, 11 Feb 2018 12:39:46 +0100 Subject: [PATCH] Remove "Spam" from translatable strings for real by sharing g_waypointsprite_spam code (damn duplicated code!) --- qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc | 7 +++---- qcsrc/common/turrets/cl_turrets.qc | 6 +----- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc index 0c336c0ab..7b3d2abb6 100644 --- a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc +++ b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc @@ -249,6 +249,8 @@ vector spritelookupcolor(entity this, string s, vector def) string spritelookuptext(entity this, string s) { + if(autocvar_g_waypointsprite_spam && waypointsprite_count >= autocvar_g_waypointsprite_spam) + return "Spam"; // no need to translate this debug string if (s == WP_RaceStartFinish.netname) return (race_checkpointtime || race_mycheckpointtime) ? _("Finish") : _("Start"); if (s == WP_Weapon.netname) return Weapons_from(this.wp_extra).m_name; if (s == WP_Item.netname) return Items_from(this.wp_extra).m_waypoint; @@ -699,10 +701,7 @@ void Draw_WaypointSprite(entity this) string txt = string_null; if (is_text) { - if (autocvar_g_waypointsprite_spam && waypointsprite_count >= autocvar_g_waypointsprite_spam) - txt = "Spam"; // no need to translate this debug string - else - txt = spritelookuptext(this, spriteimage); + txt = spritelookuptext(this, spriteimage); if (this.helpme && time < this.helpme) txt = sprintf(_("%s needing help!"), txt); if (autocvar_g_waypointsprite_uppercase) diff --git a/qcsrc/common/turrets/cl_turrets.qc b/qcsrc/common/turrets/cl_turrets.qc index 850dd0ceb..a57719b82 100644 --- a/qcsrc/common/turrets/cl_turrets.qc +++ b/qcsrc/common/turrets/cl_turrets.qc @@ -115,11 +115,7 @@ void turret_draw2d(entity this) LOG_INFOF("WARNING: sprite of name %s has no color, using pink so you notice it", spriteimage); } - txt = this.netname; - if(autocvar_g_waypointsprite_spam && waypointsprite_count >= autocvar_g_waypointsprite_spam) - txt = _("Spam"); - else - txt = spritelookuptext(this, spriteimage); + txt = spritelookuptext(this, spriteimage); if(time - floor(time) > 0.5 && t == this.team) { -- 2.39.2