void kh_WaitForPlayers();
void kh_Controller_Think(entity this) // called a lot
{
- if(intermission_running)
+ if(gameover)
return;
if(this.cnt > 0)
{
void kh_Scores_Event(entity player, entity key, string what, float frags_player, float frags_owner) // update the score when a key is captured
{
string s;
- if(intermission_running)
+ if(gameover)
return;
if(frags_player)
}
// in any case:
setattachment(key, NULL, "");
- setorigin(key, key.owner.origin + '0 0 1' * (STAT(PL_MIN, NULL).z - KH_KEY_MIN_z));
+ setorigin(key, key.owner.origin + '0 0 1' * (STAT(PL_MIN, key.owner).z - KH_KEY_MIN_z));
key.angles = key.owner.angles;
#else
setorigin(key, key.owner.origin + key.origin.z * '0 0 1');
void kh_Key_Touch(entity this, entity toucher) // runs many, many times when a key has been dropped and can be picked up
{
- if(intermission_running)
+ if(gameover)
return;
if(this.owner) // already carried
void kh_Key_Think(entity this) // runs all the time
{
- if(intermission_running)
+ if(gameover)
return;
if(this.owner)
void kh_WaitForPlayers() // delay start of the round until enough players are present
{
+ static int prev_missing_teams_mask;
if(time < game_starttime)
{
+ if (prev_missing_teams_mask > 0)
+ Kill_Notification(NOTIF_ALL, NULL, MSG_CENTER, CPID_MISSING_TEAMS);
+ prev_missing_teams_mask = -1;
kh_Controller_SetThink(game_starttime - time + 0.1, kh_WaitForPlayers);
return;
}
- static int prev_missing_teams_mask;
int missing_teams_mask = kh_GetMissingTeams();
if(!missing_teams_mask)
{
MUTATOR_HOOKFUNCTION(kh, reset_map_global)
{
- kh_Controller_SetThink(autocvar_g_balance_keyhunt_delay_round + (game_starttime - time), kh_StartRound);
+ kh_WaitForPlayers(); // takes care of killing the "missing teams" message
}