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_mutators[CAMPAIGN_MAX_ENTRIES];
string campaign_shortdesc[CAMPAIGN_MAX_ENTRIES];
string campaign_longdesc[CAMPAIGN_MAX_ENTRIES];
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_mutators[campaign_entries] = strzone(a);
CAMPAIGN_GETARG; campaign_shortdesc[campaign_entries] = strzone(a);
CAMPAIGN_GETARG; campaign_longdesc[campaign_entries] = strzone(strreplace("\\n", "\n", a));
campaign_entries = campaign_entries + 1;
- if(campaign_entries >= n)
+ if(campaign_entries >= n)
break;
}
lineno = lineno + 1;
if(Campaign_Invalid())
return;
cvar_set("fraglimit", ftos(campaign_fraglimit[0]));
- cvar_set("timelimit", "0");
+ cvar_set("timelimit", ftos(campaign_timelimit[0]));
cvar_set_normal("fraglimit", ftos(campaign_fraglimit[0]));
- cvar_set_normal("timelimit", "0");
+ cvar_set_normal("timelimit", ftos(campaign_timelimit[0]));
}
void CampaignSaveCvar(string cvarname, float value)
error("Sorry, cheater. You are NOT WELCOME.");
CampaignFile_Unload();
}
+
float GetWinningCode(float fraglimitreached, float equality)
{
- if(equality)
- if(fraglimitreached)
- return WINNING_STARTSUDDENDEATHOVERTIME;
- else
- return WINNING_NEVER;
- else
+ if(cvar("g_campaign") == 1)
if(fraglimitreached)
return WINNING_YES;
else
return WINNING_NO;
+
+ else
+ if(equality)
+ if(fraglimitreached)
+ return WINNING_STARTSUDDENDEATHOVERTIME;
+ else
+ return WINNING_NEVER;
+ else
+ if(fraglimitreached)
+ return WINNING_YES;
+ else
+ return WINNING_NO;
}
// set the .winning flag for exactly those players with a given field value