diff options
author | Marcus Huderle <huderlem@gmail.com> | 2018-07-11 09:45:06 -0500 |
---|---|---|
committer | Marcus Huderle <huderlem@gmail.com> | 2018-07-11 09:45:06 -0500 |
commit | 4fbad04ec2de7ca2529620f292356f1916b4d59d (patch) | |
tree | 5b625fd6c86d633d87e7a2363fac690aa12365d2 /src/field_control_avatar.c | |
parent | f96749deb674a2ae784708ee95c778585330b6ce (diff) |
Use bg event type constants and remove unneeded bg_event argument
Diffstat (limited to 'src/field_control_avatar.c')
-rw-r--r-- | src/field_control_avatar.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index ffdf926f5..296d9ef63 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -24,6 +24,7 @@ #include "trainer_see.h" #include "constants/vars.h" #include "wild_encounter.h" +#include "constants/bg_event_constants.h" struct Coords32 { @@ -409,34 +410,34 @@ static u8 *GetInteractedBackgroundEventScript(struct MapPosition *position, u8 m switch (bgEvent->kind) { - case 0: + case BG_EVENT_PLAYER_FACING_ANY: default: return bgEvent->bgUnion.script; - case 1: + case BG_EVENT_PLAYER_FACING_NORTH: if (direction != DIR_NORTH) return NULL; break; - case 2: + case BG_EVENT_PLAYER_FACING_SOUTH: if (direction != DIR_SOUTH) return NULL; break; - case 3: + case BG_EVENT_PLAYER_FACING_EAST: if (direction != DIR_EAST) return NULL; break; - case 4: + case BG_EVENT_PLAYER_FACING_WEST: if (direction != DIR_WEST) return NULL; break; case 5: case 6: - case 7: + case BG_EVENT_HIDDEN_ITEM: gSpecialVar_0x8004 = ((u32)bgEvent->bgUnion.script >> 16) + FLAG_HIDDEN_ITEMS_START; gSpecialVar_0x8005 = (u32)bgEvent->bgUnion.script; if (FlagGet(gSpecialVar_0x8004) == TRUE) return NULL; return HiddenItemScript; - case 8: + case BG_EVENT_SECRET_BASE: if (direction == DIR_NORTH) { gSpecialVar_0x8004 = bgEvent->bgUnion.secretBaseId; |