diff --git a/qbsp/test_qbsp.cc b/qbsp/test_qbsp.cc index 5c0043ba..0c381790 100644 --- a/qbsp/test_qbsp.cc +++ b/qbsp/test_qbsp.cc @@ -974,9 +974,9 @@ TEST_CASE("q1_cube", "[testmaps_q1]") CHECK(cube_bounds_grown.mins() == headnode.mins); CHECK(cube_bounds_grown.maxs() == headnode.maxs); - // model bounds -// CHECK(cube_bounds_grown.mins() == bsp.dmodels[0].mins); -// CHECK(cube_bounds_grown.maxs() == bsp.dmodels[0].maxs); + // model bounds are shrunk by 1 unit on each side for some reason + CHECK(cube_bounds.grow(-1).mins() == bsp.dmodels[0].mins); + CHECK(cube_bounds.grow(-1).maxs() == bsp.dmodels[0].maxs); } /** diff --git a/qbsp/writebsp.cc b/qbsp/writebsp.cc index f1c72ebe..59d86a1a 100644 --- a/qbsp/writebsp.cc +++ b/qbsp/writebsp.cc @@ -272,6 +272,12 @@ void ExportDrawNodes(mapentity_t *entity, node_t *headnode, int firstface) dmodel.mins[i] = headnode->bounds.mins()[i] + SIDESPACE; dmodel.maxs[i] = headnode->bounds.maxs()[i] - SIDESPACE; } + + // shrink the bounds in Q1 based games (Q1 engine compensates for this in Mod_LoadSubmodels) + if (options.target_game->id != GAME_QUAKE_II) { + dmodel.mins += qvec3d(1,1,1); + dmodel.maxs -= qvec3d(1,1,1); + } } //=============================================================================