From 4334f7a3793af278846dab3471fe943cb96b3883 Mon Sep 17 00:00:00 2001 From: SphericalIce Date: Wed, 20 Jan 2021 10:17:07 +0000 Subject: [PATCH] Include NUM_REFLECTION_TYPES in the ReflectionTypes enum --- include/event_object_movement.h | 4 ++-- src/event_object_movement.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/event_object_movement.h b/include/event_object_movement.h index 6abb4416f..cd76cac11 100644 --- a/include/event_object_movement.h +++ b/include/event_object_movement.h @@ -20,9 +20,9 @@ enum ReflectionTypes { REFL_TYPE_NONE, REFL_TYPE_ICE, - REFL_TYPE_WATER + REFL_TYPE_WATER, + NUM_REFLECTION_TYPES }; -#define NUM_REFLECTION_TYPES 2 #define FIGURE_8_LENGTH 72 diff --git a/src/event_object_movement.c b/src/event_object_movement.c index afbeaa593..910681241 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -7514,7 +7514,7 @@ static void ObjectEventUpdateMetatileBehaviors(struct ObjectEvent *objEvent) static void GetGroundEffectFlags_Reflection(struct ObjectEvent *objEvent, u32 *flags) { - u32 reflectionFlags[NUM_REFLECTION_TYPES] = { + u32 reflectionFlags[NUM_REFLECTION_TYPES - 1] = { [REFL_TYPE_ICE - 1] = GROUND_EFFECT_FLAG_ICE_REFLECTION, [REFL_TYPE_WATER - 1] = GROUND_EFFECT_FLAG_WATER_REFLECTION };