From 58535acf885934feb524057dcf2b773b070cd258 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 23 Mar 2020 21:46:52 -0400 Subject: better match for TryPushBoulder --- src/field_player_avatar.c | 9 ++++----- 1 file 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; } } -- cgit v1.2.3