]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/miscfunctions.qc
Merge branch 'master' into Mario/race_target_waypoint
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / miscfunctions.qc
index 64c767e5f38d5ba65459c210fc7d76bec08075e9..e91a7c219df52b9411280841ad22a995b477fee0 100644 (file)
@@ -476,16 +476,16 @@ void GetCvars(entity this, int f)
 }
 
 // decolorizes and team colors the player name when needed
-string playername(entity p)
+string playername(entity p, bool team_colorize)
 {
     string t;
-    if (teamplay && !gameover && IS_PLAYER(p))
+    if (team_colorize && teamplay && !intermission_running && IS_PLAYER(p))
     {
         t = Team_ColorCode(p.team);
         return strcat(t, strdecolorize(p.netname));
     }
     else
-        return p.netname;
+        return ColorTranslateRGB(p.netname);
 }
 
 float want_weapon(entity weaponinfo, float allguns) // WEAPONTODO: what still needs done?
@@ -1313,7 +1313,7 @@ void attach_sameorigin(entity e, entity to, string tag)
     float tagscale;
 
     org = e.origin - gettaginfo(to, gettagindex(to, tag));
-    tagscale = pow(vlen(v_forward), -2); // undo a scale on the tag
+    tagscale = (vlen(v_forward) ** -2); // undo a scale on the tag
     t_forward = v_forward * tagscale;
     t_left = v_right * -tagscale;
     t_up = v_up * tagscale;