fix bounds checks only checking [0]

This commit is contained in:
Jonathan 2023-07-21 00:21:58 -04:00
parent a2ec923b2c
commit 19500bca0a
2 changed files with 8 additions and 8 deletions

View File

@ -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());

View File

@ -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);
}
}