]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix the HUD panels to retain the teamcolor when entering a vehicle, credit to terencehill
authorSeverin Meyer <sev.ch@web.de>
Fri, 31 Jul 2015 20:05:47 +0000 (22:05 +0200)
committerSeverin Meyer <sev.ch@web.de>
Fri, 31 Jul 2015 20:05:47 +0000 (22:05 +0200)
qcsrc/client/view.qc

index d3bcf92447bc928f8c26680f18a230cd60915eb9..656ab7831630019763f6a45102eba95aec100eaa 100644 (file)
@@ -1054,7 +1054,10 @@ void CSQC_UpdateView(float w, float h)
 
        CSQCPlayer_SetCamera();
 
-       myteam = GetPlayerColor(player_localentnum - 1);
+       if(player_localentnum <= maxclients) // is it a client?
+               myteam = GetPlayerColor(player_localentnum - 1);
+       else // then player_localentnum is the vehicle I'm driving
+               myteam = GetPlayerColor(player_localnum);
 
        if(myteam != prev_myteam)
        {