]> de.git.xonotic.org Git - voretournament/voretournament.git/commitdiff
Make portraits expire after an amount of time
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sun, 29 Jan 2012 21:52:04 +0000 (23:52 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sun, 29 Jan 2012 21:52:04 +0000 (23:52 +0200)
data/qcsrc/client/hud.qc

index 58c1d3787fabcb67ed7822f100c072fec79756cf..f2a7a57309b32b11053620a7f45392143dc9e8ba 100644 (file)
@@ -1691,11 +1691,17 @@ void Sbar_Portrait()
        if(!cvar("sbar_portrait"))\r
                return;\r
 \r
-       if(portrait_time)\r
+       if(portrait_time + cvar("sbar_portrait_time") >= time)\r
        {\r
                drawpic(left + '10 -80 0', portrait_image, '120 160 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
                drawcolorcodedstring(left + '10 80 0', portrait_name, '12 12 0', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
        }\r
+       else if(portrait_time)\r
+       {\r
+               strunzone(portrait_name);\r
+               strunzone(portrait_image);\r
+               portrait_time = 0;\r
+       }\r
 }\r
 \r
 void Sbar_Score()\r