]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Allow campaigns to execute cfg files mirceakitsune/campaign_cfg 740/head
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Wed, 18 Dec 2019 18:53:26 +0000 (20:53 +0200)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Wed, 18 Dec 2019 18:59:23 +0000 (20:59 +0200)
qcsrc/server/campaign.qc

index 76e2cdeb8480069230118925719d77d9e105ae5b..3cd4147e410d9dcb51d7c492f0ff956f69db0c9c 100644 (file)
@@ -144,6 +144,16 @@ void CampaignPreInit()
        // with the menu a little still...)
        cvar_set_normal("sv_gravity", ftos(autocvar_sv_gravity));
 
+       // execute the global campaign cfg file if one exists
+       string filename = strcat("maps/campaign", campaign_name, ".cfg");
+       if(fexists(filename))
+               localcmd(strcat("exec \"", filename, "\"\n"));
+
+       // execute the campaign level cfg file if one exists
+       string filename_level = strcat("maps/campaign", campaign_name, "_", ftos(campaign_level + 1), ".cfg");
+       if(fexists(filename_level))
+               localcmd(strcat("exec \"", filename_level, "\"\n"));
+
        if(Campaign_Invalid())
                return;