1 void PutClientInServer();
4 * Resets the state of all clients, items, flags, runes, keys, weapons, waypoints, ... of the map.
6 void reset_map(float dorespawn)
11 if(time <= game_starttime && round_handler_IsActive())
12 round_handler_Reset(game_starttime + 1);
16 else MUTATOR_CALLHOOK(reset_map_global);
18 lms_lowest_lives = 999;
19 lms_next_place = player_count;
21 for(self = world; (self = nextent(self)); )
22 if(clienttype(self) == CLIENTTYPE_NOTACLIENT)
31 self.team = self.team_saved;
33 if(self.flags & FL_PROJECTILE) // remove any projectiles left
37 // Waypoints and assault start come LAST
38 for(self = world; (self = nextent(self)); )
39 if(clienttype(self) == CLIENTTYPE_NOTACLIENT)
48 // Moving the player reset code here since the player-reset depends
49 // on spawnpoint entities which have to be reset first --blub
51 if(!MUTATOR_CALLHOOK(reset_map_players))
52 FOR_EACH_CLIENT(self) {
53 if(self.flags & FL_CLIENT) // reset all players
57 only reset players if a restart countdown is active
58 this can either be due to cvar sv_ready_restart_after_countdown having set
59 restart_mapalreadyrestarted to 1 after the countdown ended or when
60 sv_ready_restart_after_countdown is not used and countdown is still running
62 if (restart_mapalreadyrestarted || (time < game_starttime))
64 //NEW: changed behaviour so that it prevents that previous spectators/observers suddenly spawn as players
65 if (self.classname == "player") {
66 //PlayerScore_Clear(self);
68 PlayerScore_Add(self, SP_LMS_LIVES, LMS_NewPlayerLives());
70 //stop the player from moving so that he stands still once he gets respawned
71 self.velocity = '0 0 0';
72 self.avelocity = '0 0 0';
73 self.movement = '0 0 0';
82 kh_Controller_SetThink_NoMsg(autocvar_g_balance_keyhunt_delay_round+(game_starttime - time), kh_StartRound);