1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-28 21:39:48 +00:00

CLEANUP: Don't assign invalid extents when loading bounding boxes

This commit is contained in:
Dave Corley 2024-07-04 21:16:52 -05:00
parent b3cee84787
commit 5bca2919c2

View file

@ -85,7 +85,8 @@ namespace NifBullet
{
if (Misc::StringUtils::ciEqual(node.mName, "Bounding Box"))
{
if (node.mBounds.mType == Nif::BoundingVolume::Type::BOX_BV)
if (node.mBounds.mType == Nif::BoundingVolume::Type::BOX_BV
&& std::ranges::all_of(node.mBounds.mBox.mExtents._v, [](float extent) { return extent > 0.f; }))
{
mShape->mCollisionBox.mExtents = node.mBounds.mBox.mExtents;
mShape->mCollisionBox.mCenter = node.mBounds.mBox.mCenter;