summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPikalaxALT <PikalaxALT@gmail.com>2020-03-23 21:46:52 -0400
committerPikalaxALT <PikalaxALT@gmail.com>2020-03-23 21:46:52 -0400
commit58535acf885934feb524057dcf2b773b070cd258 (patch)
tree345c2a2a882c6b0af5f37c7bb3984dfc4d206897 /src
parent5b3e9f376b2ed230df1d7e6d23e0239f69d10ba4 (diff)
better match for TryPushBoulder
Diffstat (limited to 'src')
-rw-r--r--src/field_player_avatar.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/field_player_avatar.c b/src/field_player_avatar.c
index c27eb2650..4b805c123 100644
--- a/src/field_player_avatar.c
+++ b/src/field_player_avatar.c
@@ -583,6 +583,7 @@ bool8 ShouldJumpLedge(s16 x, s16 y, u8 z)
bool8 TryPushBoulder(s16 x, s16 y, u8 direction)
{
u8 objectEventId;
+ u8 direction_ = direction;
if (!FlagGet(FLAG_SYS_USE_STRENGTH))
return FALSE;
@@ -595,16 +596,14 @@ bool8 TryPushBoulder(s16 x, s16 y, u8 direction)
x = gObjectEvents[objectEventId].currentCoords.x;
y = gObjectEvents[objectEventId].currentCoords.y;
- MoveCoords(direction, &x, &y);
- if (MapGridGetMetatileBehaviorAt(x, y) == MB_FALL_WARP || (GetCollisionAtCoords(&gObjectEvents[objectEventId], x, y, direction) == COLLISION_NONE && !MetatileBehavior_IsNonAnimDoor(MapGridGetMetatileBehaviorAt(x, y))))
+ MoveCoords(direction_, &x, &y);
+ if (MapGridGetMetatileBehaviorAt(x, y) == MB_FALL_WARP || (GetCollisionAtCoords(&gObjectEvents[objectEventId], x, y, direction_) == COLLISION_NONE && !MetatileBehavior_IsNonAnimDoor(MapGridGetMetatileBehaviorAt(x, y))))
{
- StartStrengthAnim(objectEventId, direction);
+ StartStrengthAnim(objectEventId, direction_);
return TRUE;
}
else
{
- direction++;
- direction--;
return FALSE;
}
}