diff --git a/src/dungeon_ai_attack_1.c b/src/dungeon_ai_attack_1.c index 7b7a57c1..3c6eb66d 100644 --- a/src/dungeon_ai_attack_1.c +++ b/src/dungeon_ai_attack_1.c @@ -4,6 +4,7 @@ #include "dungeon_pokemon_attributes.h" #include "dungeon_pokemon_attributes_1.h" #include "dungeon_util.h" +#include "dungeon_util_static.h" #include "main_0208655C.h" #include "util.h" @@ -35,7 +36,7 @@ bool8 IsTargetInRange(struct entity *user, struct entity *target, s32 direction, break; const struct tile *map_tile = GetTile(current_pos_x, current_pos_y); - if (!(map_tile->terrain_flags & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY))) + if (GetTerrainType(map_tile) == TERRAIN_TYPE_WALL) return FALSE; if (map_tile->monster == target) diff --git a/src/dungeon_map_access_1.c b/src/dungeon_map_access_1.c index 0ec4ba8b..85d52e0f 100644 --- a/src/dungeon_map_access_1.c +++ b/src/dungeon_map_access_1.c @@ -1,5 +1,6 @@ #include "dungeon_map_access_1.h" #include "dungeon.h" +#include "dungeon_util_static.h" #include "secondary_terrain_types.h" #include "tileset.h" @@ -10,12 +11,10 @@ bool8 IsTileGround(struct tile *tile) bool8 is_ground = FALSE; if (IsWaterTileset()) { - if (!(tile->terrain_flags & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY))) - { + if (GetTerrainType(tile) == TERRAIN_TYPE_WALL) is_ground = TRUE; - } } - else if ((tile->terrain_flags & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY)) != TERRAIN_TYPE_SECONDARY || + else if (GetTerrainType(tile) != TERRAIN_TYPE_SECONDARY || SECONDARY_TERRAIN_TYPES[DUNGEON_PTR[0]->gen_info.tileset_id] == SECONDARY_TERRAIN_LAVA) { is_ground = TRUE; diff --git a/src/move_checks.c b/src/move_checks.c index d8f2da90..149ccff5 100644 --- a/src/move_checks.c +++ b/src/move_checks.c @@ -205,7 +205,7 @@ bool8 StatusCheckerCheck(struct entity *attacker, struct move *move) case MOVE_DIG: { struct tile *tile = GetTileAtEntity(attacker); - if (!IsTileGround(tile) || (tile->terrain_flags & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY)) != TERRAIN_TYPE_NORMAL) + if (!IsTileGround(tile) || GetTerrainType(tile) != TERRAIN_TYPE_NORMAL) return FALSE; break; }