diff --git a/include/qbsp/qbsp.hh b/include/qbsp/qbsp.hh index 5ebbaa1e..9c48abc8 100644 --- a/include/qbsp/qbsp.hh +++ b/include/qbsp/qbsp.hh @@ -359,6 +359,7 @@ public: bool fOmitDetailFence; bool fForcePRT1; bool fTestExpand; + bool fLeakTest; options_t() { memset(this, 0, sizeof(options_t)); diff --git a/qbsp/outside.cc b/qbsp/outside.cc index a6fd878e..7bd54045 100644 --- a/qbsp/outside.cc +++ b/qbsp/outside.cc @@ -383,7 +383,12 @@ FillOutside(node_t *node, const int hullnum) StripExtension(options.szBSPName); strcat(options.szBSPName, ".prt"); remove(options.szBSPName); - + + if (options.fLeakTest) { + logprint("Aborting because -leaktest was used.\n"); + exit(1); + } + return false; } diff --git a/qbsp/qbsp.cc b/qbsp/qbsp.cc index 6d4903a0..2933c262 100644 --- a/qbsp/qbsp.cc +++ b/qbsp/qbsp.cc @@ -687,6 +687,7 @@ PrintOptions(void) " -omitdetailfence func_detail_fence brushes are omitted from the compile\n" " -convert Convert a .MAP to a different .MAP format. fmt can be: quake, quake2, valve, bp (brush primitives).\n" " -expand Write hull 1 expanded brushes to expanded.map for debugging\n" + " -leaktest Make compilation fail if the map leaks\n" " sourcefile .MAP file to process\n" " destfile .BSP file to output\n"); @@ -887,6 +888,8 @@ ParseOptions(char *szOptions) logprint(" Only use this for viewing portals in a map editor.\n"); } else if (!Q_strcasecmp(szTok, "expand")) { options.fTestExpand = true; + } else if (!Q_strcasecmp(szTok, "leaktest")) { + options.fLeakTest = true; } else if (!Q_strcasecmp(szTok, "?") || !Q_strcasecmp(szTok, "help")) PrintOptions(); else