float chase_active_old;\r
float artwork_fade;\r
string artwork_image;\r
+string intermission_song;\r
string NextFrameCommand;\r
void CSQC_UpdateView(float w, float h)\r
{\r
teamradar_view();\r
\r
// Draw artwork and play intermission music\r
- if(intermission && !isdemo()) // the match has ended\r
- if(!spectatee_status && gametype != GAME_RPG) // no one wins or loses in RPG\r
+ if(intermission && !isdemo() && gametype != GAME_RPG && !spectatee_status) // the match has ended. Don't do this for RPG because no one wins or loses there\r
{\r
if(cvar("cl_artwork"))\r
{\r
if(getstati(STAT_WINNING)) // we are the winner\r
{\r
if(cvar("cl_artwork_win"))\r
+ {\r
artwork_image = strcat("gfx/artwork_won_", ftos(floor(1 + (random() * cvar("cl_artwork_win")))));\r
+ artwork_image = strzone(artwork_image);\r
+ }\r
}\r
else // we have lost\r
{\r
if(cvar("cl_artwork_lose"))\r
+ {\r
artwork_image = strcat("gfx/artwork_lost_", ftos(floor(1 + (random() * cvar("cl_artwork_lose")))));\r
+ artwork_image = strzone(artwork_image);\r
+ }\r
}\r
- artwork_image = strzone(artwork_image);\r
}\r
\r
if(cvar("cl_artwork_stretch"))\r
if(artwork_image != "")\r
drawpic(artwork_pos, artwork_image, artwork_size, '1 1 1', artwork_fade, DRAWFLAG_NORMAL);\r
}\r
- else\r
+\r
+ if(cvar("cl_intermission") && intermission_song == "") // don't start the song each frame\r
{\r
- if(artwork_image != "")\r
+ if(getstati(STAT_WINNING))\r
+ intermission_song = cvar_string("cl_intermission_cdtrack_win");\r
+ else\r
+ intermission_song = cvar_string("cl_intermission_cdtrack_lose");\r
+ if(intermission_song != "")\r
{\r
- strunzone(artwork_image);\r
- artwork_image = "";\r
+ localcmd(strcat("\ncd play ", intermission_song, "\n"));\r
+ intermission_song = strzone(intermission_song);\r
}\r
- artwork_fade = 0;\r
+ }\r
+ }\r
+ else\r
+ {\r
+ artwork_fade = 0;\r
+ if(artwork_image != "")\r
+ {\r
+ strunzone(artwork_image);\r
+ artwork_image = "";\r
}\r
\r
- if(cvar("cl_intermission"))\r
+ if(intermission_song != "")\r
{\r
- string s;\r
- if(getstati(STAT_WINNING))\r
- s = cvar_string("cl_intermission_cdtrack_win");\r
- else\r
- s = cvar_string("cl_intermission_cdtrack_lose");\r
- if(s != "")\r
- localcmd(strcat("\ncd play ", s, "\n"));\r
+ strunzone(intermission_song);\r
+ intermission_song = "";\r
}\r
}\r
\r