string campaign_mapname[CAMPAIGN_MAX_ENTRIES];
float campaign_bots[CAMPAIGN_MAX_ENTRIES];
float campaign_botskill[CAMPAIGN_MAX_ENTRIES];
-float campaign_fraglimit[CAMPAIGN_MAX_ENTRIES];
-float campaign_timelimit[CAMPAIGN_MAX_ENTRIES];
+string campaign_fraglimit[CAMPAIGN_MAX_ENTRIES];
+string campaign_timelimit[CAMPAIGN_MAX_ENTRIES];
string campaign_mutators[CAMPAIGN_MAX_ENTRIES];
string campaign_shortdesc[CAMPAIGN_MAX_ENTRIES];
string campaign_longdesc[CAMPAIGN_MAX_ENTRIES];
CAMPAIGN_GETARG; campaign_mapname[campaign_entries] = strzone(a);
CAMPAIGN_GETARG; campaign_bots[campaign_entries] = stof(a);
CAMPAIGN_GETARG; campaign_botskill[campaign_entries] = stof(a);
- CAMPAIGN_GETARG; campaign_fraglimit[campaign_entries] = stof(a);
- CAMPAIGN_GETARG; campaign_timelimit[campaign_entries] = stof(a);
+ CAMPAIGN_GETARG; campaign_fraglimit[campaign_entries] = strzone(a);
+ CAMPAIGN_GETARG; campaign_timelimit[campaign_entries] = strzone(a);
CAMPAIGN_GETARG; campaign_mutators[campaign_entries] = strzone(a);
CAMPAIGN_GETARG; campaign_shortdesc[campaign_entries] = strzone(a);
CAMPAIGN_GETARG; campaign_longdesc[campaign_entries] = strzone(strreplace("\\n", "\n", a));
{
strfree(campaign_gametype[i]);
strfree(campaign_mapname[i]);
+ strfree(campaign_fraglimit[i]);
+ strfree(campaign_timelimit[i]);
strfree(campaign_mutators[i]);
strfree(campaign_shortdesc[i]);
strfree(campaign_longdesc[i]);
if(autocvar__campaign_testrun)
{
cvar_set("fraglimit", "0");
+ cvar_set("leadlimit", "0");
cvar_set("timelimit", "0.01");
cvar_set_normal("fraglimit", "0");
+ cvar_set_normal("leadlimit", "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]));
+ // "default" uses implicit values, "" or "0" means no limit
+ tokenizebyseparator(campaign_fraglimit[0], "+");
+ if(argv(0) != "default") {
+ cvar_set("fraglimit", argv(0));
+ cvar_set_normal("fraglimit", argv(0));
+ }
+ if(argv(1) != "default") {
+ cvar_set("leadlimit", argv(1));
+ cvar_set_normal("leadlimit", argv(1));
+ }
+ if(campaign_timelimit[0] != "default") {
+ cvar_set("timelimit", campaign_timelimit[0]);
+ cvar_set_normal("timelimit", campaign_timelimit[0]);
+ }
}
}