Skip to content

Commit

Permalink
method params were swapped which caused issues with slopes. (prime31#820
Browse files Browse the repository at this point in the history
)
  • Loading branch information
stallratte authored and NowSayPillow committed Aug 2, 2024
1 parent 7e6e749 commit c0893f5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Nez.Portable/ECS/Components/Physics/TiledMapMover.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit c0893f5

Please sign in to comment.