}
if (this.flags & FL_JUMPRELEASED) {
- if (PHYS_INPUT_BUTTON_JUMP(this) && joinAllowed(this)) {
+ if (PHYS_INPUT_BUTTON_JUMP(this) && (joinAllowed(this) || time < CS(this).jointime + MIN_SPEC_TIME)) {
this.flags &= ~FL_JUMPRELEASED;
this.flags |= FL_SPAWNING;
} else if(PHYS_INPUT_BUTTON_ATCK(this) && !CS(this).version_mismatch || this.would_spectate) {
this.flags &= ~FL_SPAWNING;
if(joinAllowed(this))
Join(this);
+ else if(time < CS(this).jointime + MIN_SPEC_TIME)
+ CS(this).autojoin_checked = -1;
return;
}
}
}
if (this.flags & FL_JUMPRELEASED) {
- if (PHYS_INPUT_BUTTON_JUMP(this) && joinAllowed(this)) {
+ if (PHYS_INPUT_BUTTON_JUMP(this) && (joinAllowed(this) || time < CS(this).jointime + MIN_SPEC_TIME)) {
this.flags &= ~FL_JUMPRELEASED;
this.flags |= FL_SPAWNING;
} else if(PHYS_INPUT_BUTTON_ATCK(this) || CS(this).impulse == 10 || CS(this).impulse == 15 || CS(this).impulse == 18 || (CS(this).impulse >= 200 && CS(this).impulse <= 209)) {
this.flags &= ~FL_SPAWNING;
if(joinAllowed(this))
Join(this);
+ else if(time < CS(this).jointime + MIN_SPEC_TIME)
+ CS(this).autojoin_checked = -1;
return;
}
}
IntermissionThink(this);
return;
}
- else if (IS_REAL_CLIENT(this) && !CS(this).autojoin_checked && time >= CS(this).jointime + MIN_SPEC_TIME)
+ else if (IS_REAL_CLIENT(this) && CS(this).autojoin_checked <= 0 && time >= CS(this).jointime + MIN_SPEC_TIME)
{
- CS(this).autojoin_checked = true;
+ bool early_join_requested = (CS(this).autojoin_checked < 0);
+ CS(this).autojoin_checked = 1;
// don't do this in ClientConnect
// many things can go wrong if a client is spawned as player on connection
- if (MUTATOR_CALLHOOK(AutoJoinOnConnection, this)
+ if (early_join_requested || MUTATOR_CALLHOOK(AutoJoinOnConnection, this)
|| (!(autocvar_sv_spectate || autocvar_g_campaign || (Player_GetForcedTeamIndex(this) == TEAM_FORCE_SPECTATOR))
&& (!teamplay || autocvar_g_balance_teams)))
{
campaign_bots_may_start = true;
- Join(this);
+ if(joinAllowed(this))
+ Join(this);
return;
}
}
wep_zoomed += thiswep.wr_zoom(thiswep, this);
}
SetZoomState(this, PHYS_INPUT_BUTTON_ZOOM(this) || PHYS_INPUT_BUTTON_ZOOMSCRIPT(this) || wep_zoomed);
- }
+ }
if (CS(this).teamkill_soundtime && time > CS(this).teamkill_soundtime)
{
ATTRIB(Client, cmd_floodtime, float, this.cmd_floodtime);
ATTRIB(Client, wasplayer, bool, this.wasplayer);
ATTRIB(Client, weaponorder_byimpulse, string, this.weaponorder_byimpulse);
- ATTRIB(Client, autojoin_checked, bool, this.wasplayer);
+ ATTRIB(Client, autojoin_checked, int, this.wasplayer);
// networked cvars
{
case CMD_REQUEST_COMMAND:
{
- if (!game_stopped)
- if (IS_CLIENT(caller) && !IS_PLAYER(caller))
- if (joinAllowed(caller))
- Join(caller);
+ if (!game_stopped && IS_CLIENT(caller) && !IS_PLAYER(caller))
+ {
+ if (joinAllowed(caller))
+ Join(caller);
+ else if(time < CS(caller).jointime + MIN_SPEC_TIME)
+ CS(caller).autojoin_checked = -1;
+ }
return; // never fall through to usage
}