Use GetTerrainType everywhere

This commit is contained in:
AnonymousRandomPerson
2025-07-19 11:16:39 -04:00
parent 342d5be6f1
commit 56111c108e
3 changed files with 6 additions and 6 deletions

View File

@@ -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)

View File

@@ -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;

View File

@@ -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;
}