1 /**
2  * @file
3  */
4 
5 /*
6 Copyright (C) 2002-2013 UFO: Alien Invasion.
7 
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 as published by the Free Software Foundation; either version 2
11 of the License, or (at your option) any later version.
12 
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16 
17 See the GNU General Public License for more details.
18 
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
22 
23 */
24 
25 #include "../../../../client.h"
26 #include "../../../../ui/ui_main.h"
27 #include "../../../cl_localentity.h"
28 #include "../../../cl_actor.h"
29 #include "../../../cl_particle.h"
30 #include "../../../cl_hud.h"
31 #include "e_event_doendround.h"
32 
33 /**
34  * @brief Performs end-of-turn processing.
35  * @param[in] self Pointer to the event structure that is currently executed
36  * @param[in] msg The netchannel message
37  * @sa CL_EndRoundAnnounce
38  */
CL_DoEndRound(const eventRegister_t * self,dbuffer * msg)39 void CL_DoEndRound (const eventRegister_t* self, dbuffer* msg)
40 {
41 	/* hud changes */
42 	if (cls.isOurRound())
43 		UI_ExecuteConfunc("endround");
44 
45 	refdef.rendererFlags &= ~RDF_IRGOGGLES;
46 
47 	/* change active player */
48 	Com_Printf("Team %i ended round\n", cl.actTeam);
49 	cl.actTeam = NET_ReadByte(msg);
50 	Com_Printf("Team %i's round started!\n", cl.actTeam);
51 
52 	/* hud changes */
53 	if (cls.isOurRound()) {
54 		/* check whether a particle has to go */
55 		CL_ParticleCheckRounds();
56 		UI_ExecuteConfunc("startround");
57 		HUD_DisplayMessage(_("Your round started!"));
58 		S_StartLocalSample("misc/roundstart", SND_VOLUME_DEFAULT);
59 		CL_ActorConditionalMoveCalc(selActor);
60 	}
61 }
62