From c0893f52b933c8ca988bded06846687a2f6850a1 Mon Sep 17 00:00:00 2001 From: stallratte <48615771+stallratte@users.noreply.github.com> Date: Fri, 12 Jul 2024 19:45:22 +0200 Subject: [PATCH] method params were swapped which caused issues with slopes. (#820) --- Nez.Portable/ECS/Components/Physics/TiledMapMover.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Nez.Portable/ECS/Components/Physics/TiledMapMover.cs b/Nez.Portable/ECS/Components/Physics/TiledMapMover.cs index 3bbe142b0..fcf7aee4b 100644 --- a/Nez.Portable/ECS/Components/Physics/TiledMapMover.cs +++ b/Nez.Portable/ECS/Components/Physics/TiledMapMover.cs @@ -290,7 +290,7 @@ bool TestMapCollision(Rectangle collisionRect, Edge direction, CollisionState co // if grounded on a slope and intersecting a slope or if grounded on a wall and intersecting a tall slope we go sticky. // tall slope here means one where the the slopeTopLeft/Right is 0, i.e. it connects to a wall var isHighSlopeNearest = collidingTile.IsSlope() && - collidingTile.GetNearestEdge(perpindicularPosition, _collidingTilesCoordinates[i].X) == + collidingTile.GetNearestEdge(_collidingTilesCoordinates[i].X, perpindicularPosition) == collidingTile.GetHighestSlopeEdge(); if ((collisionState._lastGroundTile.IsSlope() && collidingTile.IsSlope()) || (!collisionState._lastGroundTile.IsSlope() && isHighSlopeNearest)) @@ -364,7 +364,7 @@ bool TestTileCollision(TmxLayerTile tile, int x, int y, Edge edgeToTest, int per // and we were not intesecting the tile before moving. // this prevents clipping through a tile when hitting its edge: -> |\ if (edgeToTest.IsHorizontal() && tile.IsSlope() && - tile.GetNearestEdge(leadingPosition, x) == tile.GetHighestSlopeEdge()) + tile.GetNearestEdge(x, leadingPosition) == tile.GetHighestSlopeEdge()) { var moveDir = edgeToTest.OppositeEdge(); var leadingPositionPreMovement = _boxColliderBounds.GetSide(moveDir);