return;\r
\r
if(portrait_time + cvar("sbar_portrait_time") >= time)\r
- if(portrait_image && portrait_name) // prevent using bad strings\r
{\r
- drawpic(left - '120 80 0' - fade_pos, portrait_image, '120 160 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
- drawcolorcodedstring(left - '120 -80 0' - fade_pos, textShortenToWidth(portrait_name, 120, '12 12 0', stringwidth_colors), '12 12 0', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+ if(portrait_image && portrait_name) // prevent using bad strings\r
+ {\r
+ drawpic(left - '120 80 0' - fade_pos, portrait_image, '120 160 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+ drawcolorcodedstring(left - '120 -80 0' - fade_pos, textShortenToWidth(portrait_name, 120, '12 12 0', stringwidth_colors), '12 12 0', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+ }\r
+ }\r
+ else\r
+ {\r
+ // free unused strings from memory\r
+ if(portrait_image)\r
+ {\r
+ strunzone(portrait_image);\r
+ portrait_image = string_null;\r
+ }\r
+ if(portrait_name)\r
+ {\r
+ strunzone(portrait_name);\r
+ portrait_name = string_null;\r
+ }\r
}\r
}\r
\r