From 96bc8501eb9a2e1d1eeb18c5731e012c2af4f08e Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sat, 19 Jul 2025 12:35:11 +0200 Subject: [PATCH] slight var name clean-up --- src/code_806CD90.c | 19 +++++++------------ src/dungeon_map.c | 12 ++++++------ src/dungeon_misc.c | 8 ++++---- 3 files changed, 17 insertions(+), 22 deletions(-) diff --git a/src/code_806CD90.c b/src/code_806CD90.c index 8a4b64515..18ad1b95f 100644 --- a/src/code_806CD90.c +++ b/src/code_806CD90.c @@ -501,24 +501,19 @@ void DetermineAllMonsterShadow(void) u32 DetermineMonsterShadow(Entity *entity) { - const Tile *mapTile; - u32 shadowSize; - u16 terrainFlags; - EntityInfo *entityInfo; + const Tile *mapTile = GetTileAtEntitySafe(entity); + u16 terrainType = GetTerrainType(mapTile); + EntityInfo *entityInfo = GetEntInfo(entity); + u32 shadowSize = GetShadowSize(entityInfo->apparentID); - mapTile = GetTileAtEntitySafe(entity); - terrainFlags = mapTile->terrainFlags & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY); - entityInfo = GetEntInfo(entity); - shadowSize = GetShadowSize(entityInfo->apparentID); - - if (terrainFlags == (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY)) + if (terrainType == (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY)) return 6; - if (terrainFlags == TERRAIN_TYPE_NORMAL) { + if (terrainType == TERRAIN_TYPE_NORMAL) { if (IsWaterTileset()) shadowSize = gUnknown_8106EEF[shadowSize]; } - else if (terrainFlags == TERRAIN_TYPE_SECONDARY && gDungeonWaterType[gDungeon->tileset] != DUNGEON_WATER_TYPE_LAVA) + else if (terrainType == TERRAIN_TYPE_SECONDARY && gDungeonWaterType[gDungeon->tileset] != DUNGEON_WATER_TYPE_LAVA) shadowSize = gUnknown_8106EEF[shadowSize]; entityInfo->unk204 = shadowSize; diff --git a/src/dungeon_map.c b/src/dungeon_map.c index e885878ed..8e0791ef8 100644 --- a/src/dungeon_map.c +++ b/src/dungeon_map.c @@ -169,7 +169,7 @@ void DrawMinimapTile(s32 x, s32 y) const Tile *tile; Dungeon *dungeon; bool8 blinded; - u32 terrainFlags; + u32 terrainType; bool8 hallucinating; bool8 showItems; bool8 showHiddenTraps; @@ -210,7 +210,7 @@ void DrawMinimapTile(s32 x, s32 y) } tile = GetTile(x, y); - terrainFlags = GetTerrainType(tile); + terrainType = GetTerrainType(tile); hallucinating = gDungeon->unk181e8.hallucinating; blinded = gDungeon->unk181e8.blinded; showHiddenTraps = gDungeon->unk181e8.showInvisibleTrapsMonsters; @@ -273,7 +273,7 @@ void DrawMinimapTile(s32 x, s32 y) if (!tileKnown) { mapGfxType = MAP_GFX_NOTHING; if (entType == ENTITY_ITEM) { - if ((showItems || (tile->spawnOrVisibilityFlags.spawn & SPAWN_FLAG_ITEM)) && terrainFlags != TERRAIN_TYPE_WALL) { + if ((showItems || (tile->spawnOrVisibilityFlags.spawn & SPAWN_FLAG_ITEM)) && terrainType != TERRAIN_TYPE_WALL) { mapGfxType = MAP_GFX_ITEM; } } @@ -291,14 +291,14 @@ void DrawMinimapTile(s32 x, s32 y) if (lookForMapObject) { if (entType == ENTITY_ITEM) { - if ((showItems || (tile->spawnOrVisibilityFlags.spawn & SPAWN_FLAG_ITEM)) && terrainFlags != TERRAIN_TYPE_WALL) { + if ((showItems || (tile->spawnOrVisibilityFlags.spawn & SPAWN_FLAG_ITEM)) && terrainType != TERRAIN_TYPE_WALL) { mapGfxType = MAP_GFX_ITEM; lookForMapObject = FALSE; } } } if (lookForMapObject) { - if (terrainFlags != TERRAIN_TYPE_NORMAL) { + if (terrainType != TERRAIN_TYPE_NORMAL) { mapGfxType = MAP_GFX_NOTHING; lookForMapObject = FALSE; } @@ -340,7 +340,7 @@ void DrawMinimapTile(s32 x, s32 y) if (!tileKnown) { mapGfxType = 1; } - else if (terrainFlags != TERRAIN_TYPE_NORMAL) { + else if (terrainType != TERRAIN_TYPE_NORMAL) { mapGfxType = 1; } else { diff --git a/src/dungeon_misc.c b/src/dungeon_misc.c index 6e98c6b4e..e7a5efb4e 100644 --- a/src/dungeon_misc.c +++ b/src/dungeon_misc.c @@ -1453,13 +1453,13 @@ static bool8 sub_806A5A4(s16 r0) void sub_806A5B8(Entity *entity) { - s32 terrainFlags; + s32 terrainType; if (!EntityIsValid(entity)) return; - terrainFlags = GetTerrainType(GetTileAtEntitySafe(entity)); - if (terrainFlags == TERRAIN_TYPE_SECONDARY) { + terrainType = GetTerrainType(GetTileAtEntitySafe(entity)); + if (terrainType == TERRAIN_TYPE_SECONDARY) { EntityInfo *info = GetEntInfo(entity); // If lava - defrost and burn if (gDungeonWaterType[gDungeon->tileset] == DUNGEON_WATER_TYPE_LAVA) { @@ -1482,7 +1482,7 @@ void sub_806A5B8(Entity *entity) } } // If wall - decrement belly by 5 - else if (terrainFlags == TERRAIN_TYPE_WALL) { + else if (terrainType == TERRAIN_TYPE_WALL) { const u8 *str; EntityInfo *info = GetEntInfo(entity);