]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Load the correct gametype when launching a campaign map and cheats are enabled (campa...
authorterencehill <piuntn@gmail.com>
Thu, 21 Jul 2016 12:21:37 +0000 (14:21 +0200)
committerterencehill <piuntn@gmail.com>
Thu, 21 Jul 2016 12:21:37 +0000 (14:21 +0200)
qcsrc/server/campaign.qc

index 5dcd0ad9359d353687409b097c3654a1f30cd65e..163337e036ce7a22ceeab2d4b5aca3b72f192fa7 100644 (file)
@@ -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)