From: terencehill Date: Thu, 21 Jul 2016 12:21:37 +0000 (+0200) Subject: Load the correct gametype when launching a campaign map and cheats are enabled (campa... X-Git-Tag: xonotic-v0.8.2~700^2~51^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=5bea9974045cba90a81dcd8ca7ffda6b9cda6399;p=xonotic%2Fxonotic-data.pk3dir.git Load the correct gametype when launching a campaign map and cheats are enabled (campaign still doesn't get enabled) --- diff --git a/qcsrc/server/campaign.qc b/qcsrc/server/campaign.qc index 5dcd0ad93..163337e03 100644 --- a/qcsrc/server/campaign.qc +++ b/qcsrc/server/campaign.qc @@ -73,21 +73,25 @@ void CampaignPreInit() { float baseskill; string title; - if(autocvar_sv_cheats) - { - CampaignBailout("JOLLY CHEATS AHAHAHAHAHAHAH))"); - return; - } campaign_level = autocvar__campaign_index; campaign_name = strzone(autocvar__campaign_name); campaign_index_var = strzone(strcat("g_campaign", campaign_name, "_index")); CampaignFile_Load(campaign_level, 2); + if(campaign_entries < 1) { CampaignBailout("unknown map"); return; } + if(autocvar_sv_cheats) + { + MapInfo_SwitchGameType(MapInfo_Type_FromString(campaign_gametype[0])); + CampaignFile_Unload(); + CampaignBailout("JOLLY CHEATS AHAHAHAHAHAHAH))"); + return; + } + baseskill = autocvar_g_campaign_skill; baseskill = baseskill + campaign_botskill[0]; if(baseskill < 0)