X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fcampaign_file.qc;h=8bac6f35ee05678647caf62ec410df13bf5da770;hb=64d62de6e06d81a185c073b02acb74696d4e4f1f;hp=d3efe77e844a498365a55ce6c264c5a554df0dd7;hpb=35eff34d3dd4296ca9a9ab553f6d71e76dd9581f;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/campaign_file.qc b/qcsrc/common/campaign_file.qc index d3efe77e8..8bac6f35e 100644 --- a/qcsrc/common/campaign_file.qc +++ b/qcsrc/common/campaign_file.qc @@ -52,16 +52,14 @@ float CampaignFile_Load(int offset, float n) a = ""; \ else \ ++i -// What you're seeing here is what people will do when your compiler supports -// C-style macros but no line continuations. i = -1; // starts at -1 so I don't need postincrement; that is, i points to BEFORE the current arg! CAMPAIGN_GETARG; campaign_gametype[campaign_entries] = strzone(a); CAMPAIGN_GETARG; campaign_mapname[campaign_entries] = strzone(a); 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_fraglimit[campaign_entries] = strzone(a); + CAMPAIGN_GETARG; campaign_timelimit[campaign_entries] = strzone(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)); @@ -88,16 +86,17 @@ void CampaignFile_Unload() { if(campaign_title) { - strunzone(campaign_title); + strfree(campaign_title); for(int i = 0; i < campaign_entries; ++i) { - strunzone(campaign_gametype[i]); - strunzone(campaign_mapname[i]); - strunzone(campaign_mutators[i]); - strunzone(campaign_shortdesc[i]); - strunzone(campaign_longdesc[i]); + strfree(campaign_gametype[i]); + strfree(campaign_mapname[i]); + strfree(campaign_fraglimit[i]); + strfree(campaign_timelimit[i]); + strfree(campaign_mutators[i]); + strfree(campaign_shortdesc[i]); + strfree(campaign_longdesc[i]); } campaign_entries = 0; - campaign_title = string_null; } }