mirror of
https://github.com/pret/pmd-sky.git
synced 2026-10-01 06:37:50 -05:00
Use GetTerrainType everywhere
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user