diff --git a/qbsp/test_qbsp.cc b/qbsp/test_qbsp.cc index c6a7f75e..7766f52b 100644 --- a/qbsp/test_qbsp.cc +++ b/qbsp/test_qbsp.cc @@ -908,6 +908,8 @@ TEST_CASE("features", "[testmaps_q1]") const auto [bsp, bspx, prt] = LoadTestmapQ1("qbspfeatures.map"); REQUIRE(prt.has_value()); + + CHECK(bsp.loadversion == &bspver_q1); } bool PortalMatcher(const prtfile_winding_t& a, const prtfile_winding_t &b) diff --git a/qbsp/writebsp.cc b/qbsp/writebsp.cc index a1c354e9..bf2fb6cc 100644 --- a/qbsp/writebsp.cc +++ b/qbsp/writebsp.cc @@ -30,6 +30,7 @@ #include #include +#include using nlohmann::json; /** @@ -156,6 +157,10 @@ static void ExportLeaf(mapentity_t *entity, node_t *node) dleaf.contents = remapped.native; + if (node->bounds.maxs()[0] < node->bounds.mins()[0]) { + throw std::runtime_error("leaf bounds was unassigned"); + } + /* * write bounding box info */