From 19500bca0a8bf0957a6ce0e9d85cff0719447a96 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Fri, 21 Jul 2023 00:21:58 -0400 Subject: [PATCH] fix bounds checks only checking [0] --- qbsp/brush.cc | 8 ++++---- qbsp/map.cc | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/qbsp/brush.cc b/qbsp/brush.cc index 113917e5..e1350218 100644 --- a/qbsp/brush.cc +++ b/qbsp/brush.cc @@ -934,16 +934,16 @@ bool bspbrush_t::update_bounds(bool warn_on_failures) for (size_t i = 0; i < 3; i++) { // todo: map_source_location in bspbrush_t - if (this->bounds.mins()[0] <= -qbsp_options.worldextent.value() || - this->bounds.maxs()[0] >= qbsp_options.worldextent.value()) { + if (this->bounds.mins()[i] <= -qbsp_options.worldextent.value() || + this->bounds.maxs()[i] >= qbsp_options.worldextent.value()) { if (warn_on_failures) { logging::print( "WARNING: {}: brush bounds out of range\n", mapbrush ? mapbrush->line : parser_source_location()); } return false; } - if (this->bounds.mins()[0] >= qbsp_options.worldextent.value() || - this->bounds.maxs()[0] <= -qbsp_options.worldextent.value()) { + if (this->bounds.mins()[i] >= qbsp_options.worldextent.value() || + this->bounds.maxs()[i] <= -qbsp_options.worldextent.value()) { if (warn_on_failures) { logging::print( "WARNING: {}: no visible sides on brush\n", mapbrush ? mapbrush->line : parser_source_location()); diff --git a/qbsp/map.cc b/qbsp/map.cc index 5fbc2609..fb333101 100644 --- a/qbsp/map.cc +++ b/qbsp/map.cc @@ -374,12 +374,12 @@ inline void CalculateBrushBounds(mapbrush_t &ob) } for (size_t i = 0; i < 3; i++) { - if (ob.bounds.mins()[0] <= -qbsp_options.worldextent.value() || - ob.bounds.maxs()[0] >= qbsp_options.worldextent.value()) { + if (ob.bounds.mins()[i] <= -qbsp_options.worldextent.value() || + ob.bounds.maxs()[i] >= qbsp_options.worldextent.value()) { logging::print("WARNING: {}: brush bounds out of range\n", ob.line); } - if (ob.bounds.mins()[0] >= qbsp_options.worldextent.value() || - ob.bounds.maxs()[0] <= -qbsp_options.worldextent.value()) { + if (ob.bounds.mins()[i] >= qbsp_options.worldextent.value() || + ob.bounds.maxs()[i] <= -qbsp_options.worldextent.value()) { logging::print("WARNING: {}: no visible sides on brush\n", ob.line); } }