diff options
author | Marcus Huderle <huderlem@gmail.com> | 2018-07-13 18:53:14 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-13 18:53:14 -0700 |
commit | 68cf5eb3cbff3b0eac6cd348c7e6c594c287d67b (patch) | |
tree | 6cbdbe8e87708ffca6a49d6b507ed6341b26f4e2 /src/field_control_avatar.c | |
parent | 9238533346fd97c67e48fee33a204d1e8e2dd0a7 (diff) | |
parent | 7dffb108b834afdee807998af24e1ddc4c85d4f9 (diff) |
Merge pull request #654 from huderlem/movement_constants
Move and use movement constants
Diffstat (limited to 'src/field_control_avatar.c')
-rw-r--r-- | src/field_control_avatar.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index ffdf926f5..7a438e100 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -24,6 +24,8 @@ #include "trainer_see.h" #include "constants/vars.h" #include "wild_encounter.h" +#include "constants/bg_event_constants.h" +#include "constants/map_types.h" struct Coords32 { @@ -409,34 +411,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; |