mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-27 13:53:52 +01:00
Merge pull request #1584 from sphericalice/patch-1
Remove some magic numbers from TryPushBoulder
This commit is contained in:
commit
643cc62f73
@ -735,13 +735,13 @@ static bool8 TryPushBoulder(s16 x, s16 y, u8 direction)
|
|||||||
{
|
{
|
||||||
u8 objectEventId = GetObjectEventIdByXY(x, y);
|
u8 objectEventId = GetObjectEventIdByXY(x, y);
|
||||||
|
|
||||||
if (objectEventId != 16 && gObjectEvents[objectEventId].graphicsId == OBJ_EVENT_GFX_PUSHABLE_BOULDER)
|
if (objectEventId != OBJECT_EVENTS_COUNT && gObjectEvents[objectEventId].graphicsId == OBJ_EVENT_GFX_PUSHABLE_BOULDER)
|
||||||
{
|
{
|
||||||
x = gObjectEvents[objectEventId].currentCoords.x;
|
x = gObjectEvents[objectEventId].currentCoords.x;
|
||||||
y = gObjectEvents[objectEventId].currentCoords.y;
|
y = gObjectEvents[objectEventId].currentCoords.y;
|
||||||
MoveCoords(direction, &x, &y);
|
MoveCoords(direction, &x, &y);
|
||||||
if (GetCollisionAtCoords(&gObjectEvents[objectEventId], x, y, direction) == COLLISION_NONE
|
if (GetCollisionAtCoords(&gObjectEvents[objectEventId], x, y, direction) == COLLISION_NONE
|
||||||
&& MetatileBehavior_IsNonAnimDoor(MapGridGetMetatileBehaviorAt(x, y)) == 0)
|
&& MetatileBehavior_IsNonAnimDoor(MapGridGetMetatileBehaviorAt(x, y)) == FALSE)
|
||||||
{
|
{
|
||||||
StartStrengthAnim(objectEventId, direction);
|
StartStrengthAnim(objectEventId, direction);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user