diff options
author | SphericalIce <sphericalice@outlook.com> | 2021-01-20 10:34:33 +0000 |
---|---|---|
committer | SphericalIce <sphericalice@outlook.com> | 2021-01-20 10:34:33 +0000 |
commit | 86297398e693d081ab3b561e7b0316a4fd495d87 (patch) | |
tree | 914e3eab700fb1d56c996bef690a7f83e581d203 /src | |
parent | 4334f7a3793af278846dab3471fe943cb96b3883 (diff) |
Move the definition of RETURN_REFLECTION_TYPE_AT and make use of REFL_TYPE_NONE
Diffstat (limited to 'src')
-rw-r--r-- | src/event_object_movement.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/event_object_movement.c b/src/event_object_movement.c index 910681241..fa7e5aa1f 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -7703,6 +7703,12 @@ static void GetGroundEffectFlags_JumpLanding(struct ObjectEvent *objEvent, u32 * } } +#define RETURN_REFLECTION_TYPE_AT(x, y) \ + b = MapGridGetMetatileBehaviorAt(x, y); \ + result = GetReflectionTypeByMetatileBehavior(b); \ + if (result != REFL_TYPE_NONE) \ + return result; + static u8 GetObjEventReflectionType(struct ObjectEvent *objEvent) { const struct ObjectEventGraphicsInfo *info = GetObjectEventGraphicsInfo(objEvent->graphicsId); @@ -7716,12 +7722,6 @@ static u8 GetObjEventReflectionType(struct ObjectEvent *objEvent) u8 b; s16 one; -#define RETURN_REFLECTION_TYPE_AT(x, y) \ - b = MapGridGetMetatileBehaviorAt(x, y); \ - result = GetReflectionTypeByMetatileBehavior(b); \ - if (result != 0) \ - return result; - for (i = 0, one = 1; i < height; i++) { RETURN_REFLECTION_TYPE_AT(objEvent->currentCoords.x, objEvent->currentCoords.y + one + i) @@ -7734,10 +7734,11 @@ static u8 GetObjEventReflectionType(struct ObjectEvent *objEvent) RETURN_REFLECTION_TYPE_AT(objEvent->previousCoords.x - j, objEvent->previousCoords.y + one + i) } } - return 0; + + return REFL_TYPE_NONE; +} #undef RETURN_REFLECTION_TYPE_AT -} static u8 GetReflectionTypeByMetatileBehavior(u32 behavior) { |