More intermission music client side, and fix an issue I introduced
[voretournament/voretournament.git] / data / qcsrc / client / View.qc
index c9b1c7c65f03044e73713998b5b04cec212b97e9..a0e9db92bc153ceea52169bd9e3325b42ed832ec 100644 (file)
@@ -490,57 +490,70 @@ void CSQC_UpdateView(float w, float h)
          )\r
                teamradar_view();\r
 \r
-       // Draw Artwork\r
+       // Draw artwork and play intermission music\r
        if(intermission && !isdemo()) // the match has ended\r
-       if(cvar("cl_artwork"))\r
        if(!spectatee_status && gametype != GAME_RPG) // no one wins or loses in RPG\r
        {\r
-               if(artwork_image == "")\r
+               if(cvar("cl_artwork"))\r
                {\r
-                       if(getstati(STAT_WINNING)) // we are the winner\r
+                       if(artwork_image == "")\r
                        {\r
-                               if(cvar("cl_artwork_win"))\r
-                                       artwork_image = strcat("gfx/artwork_won_", ftos(floor(1 + (random() * cvar("cl_artwork_win")))));\r
+                               if(getstati(STAT_WINNING)) // we are the winner\r
+                               {\r
+                                       if(cvar("cl_artwork_win"))\r
+                                               artwork_image = strcat("gfx/artwork_won_", ftos(floor(1 + (random() * cvar("cl_artwork_win")))));\r
+                               }\r
+                               else // we have lost\r
+                               {\r
+                                       if(cvar("cl_artwork_lose"))\r
+                                               artwork_image = strcat("gfx/artwork_lost_", ftos(floor(1 + (random() * cvar("cl_artwork_lose")))));\r
+                               }\r
+                               artwork_image = strzone(artwork_image);\r
+                       }\r
+\r
+                       if(cvar("cl_artwork_stretch"))\r
+                       {\r
+                               artwork_size_x = vid_conwidth;\r
+                               artwork_size_y = vid_conheight;\r
+                               artwork_pos_x = 0;\r
+                               artwork_pos_y = 0;\r
                        }\r
-                       else // we have lost\r
+                       else\r
                        {\r
-                               if(cvar("cl_artwork_lose"))\r
-                                       artwork_image = strcat("gfx/artwork_lost_", ftos(floor(1 + (random() * cvar("cl_artwork_lose")))));\r
+                               artwork_size_x = max(vid_conwidth, vid_conheight);\r
+                               artwork_size_y = max(vid_conwidth, vid_conheight);\r
+                               artwork_pos_x = (vid_conwidth - artwork_size_x) / 2;\r
+                               artwork_pos_y = (vid_conheight - artwork_size_y) / 2;\r
                        }\r
-                       artwork_image = strzone(artwork_image);\r
-               }\r
 \r
-               if(cvar("cl_artwork_stretch"))\r
-               {\r
-                       artwork_size_x = vid_conwidth;\r
-                       artwork_size_y = vid_conheight;\r
-                       artwork_pos_x = 0;\r
-                       artwork_pos_y = 0;\r
+                       if(artwork_fade < cvar("cl_artwork_alpha") && cvar("cl_artwork_fade"))\r
+                               artwork_fade += frametime * cvar("cl_artwork_fade");\r
+                       else\r
+                               artwork_fade = cvar("cl_artwork_alpha");\r
+\r
+                       if(artwork_image != "")\r
+                               drawpic(artwork_pos, artwork_image, artwork_size, '1 1 1', artwork_fade, DRAWFLAG_NORMAL);\r
                }\r
                else\r
                {\r
-                       artwork_size_x = max(vid_conwidth, vid_conheight);\r
-                       artwork_size_y = max(vid_conwidth, vid_conheight);\r
-                       artwork_pos_x = (vid_conwidth - artwork_size_x) / 2;\r
-                       artwork_pos_y = (vid_conheight - artwork_size_y) / 2;\r
+                       if(artwork_image != "")\r
+                       {\r
+                               strunzone(artwork_image);\r
+                               artwork_image = "";\r
+                       }\r
+                       artwork_fade = 0;\r
                }\r
 \r
-               if(artwork_fade < cvar("cl_artwork_alpha") && cvar("cl_artwork_fade"))\r
-                       artwork_fade += frametime * cvar("cl_artwork_fade");\r
-               else\r
-                       artwork_fade = cvar("cl_artwork_alpha");\r
-\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(artwork_image != "")\r
+               if(cvar("cl_intermission"))\r
                {\r
-                       strunzone(artwork_image);\r
-                       artwork_image = "";\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
                }\r
-               artwork_fade = 0;\r
        }\r
 \r
        // draw sbar\r