From: Mircea Kitsune Date: Wed, 18 Dec 2019 18:53:26 +0000 (+0200) Subject: Allow campaigns to execute cfg files X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a0c1d4d9f0841e54ea9c9fd635f2d34f39d9fbec;p=xonotic%2Fxonotic-data.pk3dir.git Allow campaigns to execute cfg files --- diff --git a/qcsrc/server/campaign.qc b/qcsrc/server/campaign.qc index 76e2cdeb8..3cd4147e4 100644 --- a/qcsrc/server/campaign.qc +++ b/qcsrc/server/campaign.qc @@ -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;