From a34c9ab91b553fcb1f72b94eb912b94bea58885b Mon Sep 17 00:00:00 2001 From: Cheng Hann Gan Date: Thu, 9 Dec 2021 13:56:12 -0500 Subject: AI decomp + type cleanup (#82) * Decomped SetAction() * Changed MapTile.tileType to u16 bit field * Decomped FindStraightThrowableTargets() * Cleaned up CannotAttack() * Cleaned up some externs * Converted dungeon action to substruct --- include/map.h | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) (limited to 'include/map.h') diff --git a/include/map.h b/include/map.h index a0a5660..38fe68a 100644 --- a/include/map.h +++ b/include/map.h @@ -5,21 +5,11 @@ #define MAX_ROOM_COUNT 24 // Empirical max, not sure if the code supports any more. - -struct MapTileBitFlagStair -{ - /* 0x0 */ u8 tileFlags; - /* 0x1 */ bool8 stairs; -}; - struct MapTile { - // TODO: can we get rid of the union... is tileFlags a u16 only? - union MapTileUnion - { - struct MapTileBitFlagStair unk0; - u16 tileFlags_u16; - } MapTileUnion; + // Uses the TileType bit flags. + /* 0x0 */ u16 tileType; + u8 fill2[0x4 - 0x2]; u16 unk4; u16 unk6; u8 unk8; @@ -52,9 +42,10 @@ struct RoomExit s16 y; }; -enum TileFlag +enum TileType { TILE_TYPE_FLOOR = 1 << 0, + TILE_TYPE_UNK_1 = 1 << 1, TILE_TYPE_LIQUID = 1 << 2, // Water or lava depending on the dungeon. TILE_TYPE_ROOM_EXIT = 1 << 3, TILE_TYPE_MAP_EDGE = 1 << 4, -- cgit v1.2.3