cvar_string = cvar_string_normal;
cvar_set = cvar_set_normal;
cvar_set("g_campaign", "0");
- print("campaign initialization failed: ", s, "\n");
+ print("^4campaign initialization failed: ", s, "\n");
+ if(autocvar__campaign_testrun)
+ error("CAMPAIGN FAIL AHAHAHAHAHAHAHAHAH))");
return 1;
}
// now some sanity checks
if(Campaign_Invalid())
return;
- cvar_set("fraglimit", ftos(campaign_fraglimit[0]));
- cvar_set("timelimit", ftos(campaign_timelimit[0]));
- cvar_set_normal("fraglimit", ftos(campaign_fraglimit[0]));
- cvar_set_normal("timelimit", ftos(campaign_timelimit[0]));
+ if(autocvar__campaign_testrun)
+ {
+ cvar_set("fraglimit", "0");
+ cvar_set("timelimit", "0.01");
+ cvar_set_normal("fraglimit", "0");
+ cvar_set_normal("timelimit", "0.01");
+ }
+ else
+ {
+ cvar_set("fraglimit", ftos(campaign_fraglimit[0]));
+ cvar_set("timelimit", ftos(campaign_timelimit[0]));
+ cvar_set_normal("fraglimit", ftos(campaign_fraglimit[0]));
+ cvar_set_normal("timelimit", ftos(campaign_timelimit[0]));
+ }
}
void CampaignSaveCvar(string cvarname, float value)
head = head.chain;
}
- if(won == 1 && lost == 0 && checkrules_equality == 0 && cheatcount_total == 0)
+ if(autocvar__campaign_testrun)
+ {
+ campaign_won = 1;
+ bprint("Campaign test run, advancing level.\n");
+ }
+ else if(won == 1 && lost == 0 && checkrules_equality == 0)
{
if(autocvar_timelimit != 0 && autocvar_fraglimit != 0 && time > autocvar_timelimit * 60) // checks if the timelimit has expired.
{
// sound!
}
- if(campaign_won)
+ if(campaign_won && cheatcount_total == 0 && !autocvar__campaign_testrun)
{
- if(campaign_entries < 2)
+ if(campaign_level == cvar_normal(campaign_index_var))
{
- // I have won
- if(campaign_level == cvar_normal(campaign_index_var))
+ if(campaign_entries < 2)
{
+ // I have won
savevar = strcat("g_campaign", campaign_name, "_won");
CampaignSaveCvar(savevar, 1);
// advance level (for menu to show it right)
CampaignSaveCvar(campaign_index_var, campaign_level + 1);
}
- }
- else if(campaign_level == cvar_normal(campaign_index_var))
- {
- // advance level
- CampaignSaveCvar(campaign_index_var, campaign_level + 1);
+ else
+ {
+ // advance level
+ CampaignSaveCvar(campaign_index_var, campaign_level + 1);
+ }
}
}
}
if(campaign_won && campaign_entries < 2)
{
// last map won!
+ print("^2test run: campaign looks GOOD\n");
localcmd("togglemenu 1\n");
CampaignFile_Unload();
return;