seta _spec_forfeit_bindupdate 0
seta spec_forfeit_ask 1 "allow asking for forfeit confirmation"
-alias spec_forfeit "spectate \"\" ASK_FORFEIT"
+alias spec_forfeit "spectate \"\" ${spec_forfeit_ask}${_menu_forfeit_dialog_available}"
alias spec "spectate ${* ?}"
// TODO: Remove cvar_cl_handicap vector after 0.9 release
#ifdef GAMEQC
-REPLICATE_INIT(bool, cvar_spec_forfeit_ask);
-REPLICATE_INIT(bool, cvar__menu_forfeit_dialog_available);
REPLICATE_INIT(bool, cvar_cl_autoswitch);
REPLICATE_INIT(int, cvar_cl_autoscreenshot);
REPLICATE_INIT(bool, cvar_cl_clippedspectating);
REPLICATE_INIT(float, cvar_cl_handicap_damage_taken);
REPLICATE_INIT(bool, cvar_cl_noantilag);
REPLICATE_INIT(string, cvar_g_xonoticversion);
-REPLICATE(cvar_spec_forfeit_ask, bool, "spec_forfeit_ask");
-REPLICATE(cvar__menu_forfeit_dialog_available, bool, "_menu_forfeit_dialog_available");
REPLICATE(cvar_cl_autoswitch, bool, "cl_autoswitch");
REPLICATE(cvar_cl_autoscreenshot, int, "cl_autoscreenshot");
REPLICATE(cvar_cl_clippedspectating, bool, "cl_clippedspectating");
return;
}
- bool forfeit_now =
- (warmup_stage || !caller.cvar_spec_forfeit_ask || argv(2) != "ASK_FORFEIT");
+ bool forfeit_ask = (!warmup_stage && stof(argv(2)));
- if (IS_PLAYER(caller) && !forfeit_now && caller.cvar__menu_forfeit_dialog_available)
+ if (IS_PLAYER(caller) && forfeit_ask)
{
// ask player to confirm the forfeit
stuffcmd(caller, "menu_showforfeitdialog\n");
if (mutator_returnvalue == MUT_SPECCMD_RETURN_FORFEIT)
{
- if (forfeit_now || !caller.cvar__menu_forfeit_dialog_available)
+ if (!forfeit_ask)
mutator_returnvalue = MUT_SPECCMD_FORCE;
else
{
default:
case CMD_REQUEST_USAGE:
{
- sprint(caller, "\nUsage:^3 cmd spectate [<client>] [ASK_FORFEIT]\n");
+ sprint(caller, "\nUsage:^3 cmd spectate [<client>] [<ask_forfeit>]\n");
sprint(caller, " Where <client> can be the player to spectate.\n");
sprint(caller, " If <client> is \"\" or not specified, caller becomes observer.\n");
- sprint(caller, " If <client> is \"\", ASK_FORFEIT means caller will be asked"
+ sprint(caller, " If <client> is \"\" and forfeit_ask is not 0 caller will be asked"
" to confirm forfeiting the current game.\n");
return;
}