Update collide.cpp

This commit is contained in:
Lwmte 2021-09-04 15:48:21 +03:00
parent 7e881c3b19
commit 31b10d37ad

View file

@ -314,11 +314,15 @@ bool CollideStaticSolid(ITEM_INFO* item, MESH_INFO* mesh, COLL_INFO* coll)
}
}
if (closestPlane != -1)
{
// This should never happen, but still
if (closestPlane == -1)
return false;
// Debug raycast
{
Vector3 p = collBounds.Center + (closestRay.direction * minDistance);
g_Renderer.addLine3D(collBounds.Center, p, Vector4(1, 0, 1, 1));
}
// Calculate delta between tested ray and original collision ray.
// It is needed because tests are done on rays inverted in space which
@ -364,7 +368,6 @@ bool CollideStaticSolid(ITEM_INFO* item, MESH_INFO* mesh, COLL_INFO* coll)
// coll->collType = CT_LEFT;
// break;
//}
}
return true;
}