2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-10 04:27:42 +00:00

Various bug fixes

This commit is contained in:
Jack Andersen
2019-02-07 15:08:15 -10:00
parent 5600bf5172
commit 5f8b65e3b5
7 changed files with 27 additions and 27 deletions

View File

@@ -65,7 +65,9 @@ void CWallWalker::AlignToFloor(CStateManager& mgr, float radius, const zeus::CVe
for (u16 i = 0; i < triArr.GetSize(); ++i) {
u16 triIdx = triArr.GetAt(i);
CCollisionSurface surf = leaf.GetOctTree().GetMasterListTriangle(triIdx);
if (std::fabs(surf.GetPlane().pointToPlaneDist(newPos)) < margin && PointOnSurface(surf, newPos)) {
float dist = std::fabs(surf.GetPlane().pointToPlaneDist(newPos));
if (dist < margin && PointOnSurface(surf, newPos)) {
margin = dist;
x568_alignNormal = surf;
hasSurface = true;
}