if (CS(e).race_completed) sf |= BIT(0); // forced scoreboard
if (CS(to).spectatee_status) sf |= BIT(1); // spectator ent number follows
if (CS(e).zoomstate) sf |= BIT(2); // zoomed
+ if (observe_blocked_if_eliminated && INGAME(to))
+ sf |= BIT(3); // observing blocked
if (autocvar_sv_showspectators == 1 || (autocvar_sv_showspectators && IS_SPEC(to)))
sf |= BIT(4); // show spectators
{
if (vote_called) { VoteCount(false); }
this.ready = false;
- if (warmup_stage) recount_ready = true;
+ if (warmup_stage || game_starttime > time) recount_ready = true;
}
entcs_update_players(this);
}
this.alivetime = time;
antilag_clear(this, CS(this));
+
+ if (warmup_stage == -1)
+ ReadyCount();
}
/** Called when a client spawns in the server */
WriteString(msg_type, autocvar_g_xonoticversion);
WriteByte(msg_type, CS(this).version_mismatch);
WriteByte(msg_type, (CS(this).version < autocvar_gameversion));
+ WriteByte(msg_type, map_minplayers);
+ WriteByte(msg_type, GetPlayerLimit());
MUTATOR_CALLHOOK(BuildMutatorsPrettyString, "");
string modifications = M_ARGV(0, string);
if (!autocvar_sv_foginterval && world.fog != "")
stuffcmd(this, strcat("\nfog ", world.fog, "\nr_fog_exp2 0\nr_drawfog 1\n"));
- if (autocvar_sv_teamnagger && !(autocvar_bot_vs_human && AvailableTeams() == 2))
+ if (autocvar_sv_teamnagger && !(autocvar_bot_vs_human && AVAILABLE_TEAMS == 2))
if(!MUTATOR_CALLHOOK(HideTeamNagger, this))
send_CSQC_teamnagger();
if (this.personal) delete(this.personal);
this.playerid = 0;
- if (warmup_stage) ReadyCount();
+ if (warmup_stage || game_starttime > time) ReadyCount();
if (vote_called && IS_REAL_CLIENT(this)) VoteCount(false);
player_powerups_remove_all(this); // stop powerup sound
{
if(g_duel)
return 2; // TODO: this workaround is needed since the mutator hook from duel can't be activated before the gametype is loaded (e.g. switching modes via gametype vote screen)
- int player_limit = autocvar_g_maxplayers;
+ // don't return map_maxplayers during intermission as it would interfere with MapHasRightSize()
+ int player_limit = (autocvar_g_maxplayers >= 0 || intermission_running) ? autocvar_g_maxplayers : map_maxplayers;
MUTATOR_CALLHOOK(GetPlayerLimit, player_limit);
player_limit = M_ARGV(0, int);
- return player_limit;
+ return player_limit < maxclients ? player_limit : 0;
}
/**
static float msg_time = 0;
if(this && !INGAME(this) && ignore && !free_slots && time > msg_time)
{
- Send_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CENTER_JOIN_PREVENT);
+ Send_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CENTER_JOIN_PREVENT, player_limit);
msg_time = time + 0.5;
}
}
CS(this).impulse = 0;
} else if(PHYS_INPUT_BUTTON_ATCK2(this)) {
- this.would_spectate = false;
- this.flags &= ~FL_JUMPRELEASED;
- TRANSMUTE(Observer, this);
- PutClientInServer(this);
+ if(!observe_blocked_if_eliminated || !INGAME(this)) {
+ this.would_spectate = false;
+ this.flags &= ~FL_JUMPRELEASED;
+ TRANSMUTE(Observer, this);
+ PutClientInServer(this);
+ }
} else if(!SpectateUpdate(this) && !SpectateNext(this)) {
PutObserverInServer(this, false, true);
this.would_spectate = true;