+#if defined(CSQC)
+#elif defined(MENUQC)
+#elif defined(SVQC)
+ #include "../dpdefs/progsdefs.qh"
+ #include "../dpdefs/dpextensions.qh"
+ #include "util.qh"
+ #include "campaign_common.qh"
+#endif
+
// CampaignFileLoad(offset, n)
// - Loads campaign level data (up to n entries starting at offset)
// into the globals
{
entlen = tokenize(l); // using insane tokenizer for CSV
-#define CAMPAIGN_GETARG0 if(i >= entlen)
-#define CAMPAIGN_GETARG1 CAMPAIGN_GETARG0 error("syntax error in campaign file: line has not enough fields");
-#define CAMPAIGN_GETARG2 CAMPAIGN_GETARG1 a = argv(++i);
-#define CAMPAIGN_GETARG3 CAMPAIGN_GETARG2 if(a == ",")
-#define CAMPAIGN_GETARG4 CAMPAIGN_GETARG3 a = "";
-#define CAMPAIGN_GETARG5 CAMPAIGN_GETARG4 else
-#define CAMPAIGN_GETARG CAMPAIGN_GETARG5 ++i
+#define CAMPAIGN_GETARG \
+ a = argv(++i); \
+ if(a == ",") \
+ a = ""; \
+ else \
+ ++i
// What you're seeing here is what people will do when your compiler supports
// C-style macros but no line continuations.
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));
+
+ if(i > entlen)
+ error("syntax error in campaign file: line has not enough fields");
+
campaign_entries = campaign_entries + 1;
- if(campaign_entries >= n)
+ if(campaign_entries >= n)
break;
}
lineno = lineno + 1;