summaryrefslogtreecommitdiff
path: root/src/dungeon_map_access.c
diff options
context:
space:
mode:
authorAnonymousRandomPerson <chenghanngan.us@gmail.com>2022-02-20 21:59:07 -0500
committerAnonymousRandomPerson <chenghanngan.us@gmail.com>2022-02-20 21:59:23 -0500
commit60a19d681cda14c4ebeab5d18a98e3b07a5e93a3 (patch)
treef660e34515e72a33f68af5f8822dd2eb1628dc08 /src/dungeon_map_access.c
parent96372eb336d21e5da66246983e0522212f370bdf (diff)
Decomped GetMapTile_2
Diffstat (limited to 'src/dungeon_map_access.c')
-rw-r--r--src/dungeon_map_access.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/dungeon_map_access.c b/src/dungeon_map_access.c
index 43e0e4d..9ffa633 100644
--- a/src/dungeon_map_access.c
+++ b/src/dungeon_map_access.c
@@ -3,13 +3,25 @@
#include "dungeon_global_data.h"
-extern struct MapTile *gUnknown_203B430;
+extern struct unkStruct_202F190 gUnknown_202F190;
+extern struct unkStruct_202F190 *gUnknown_203B430;
-struct MapTile* GetMapTileAtPosition(s32 x, s32 y)
+struct MapTile* GetMapTile_1(s32 x, s32 y)
{
if (x >= 0 && y >= 0 && x < DUNGEON_MAX_SIZE_X && y < DUNGEON_MAX_SIZE_Y)
{
- return gDungeonGlobalData->mapEntityPointers[y][x];
+ return gDungeonGlobalData->mapTilePointers[y][x];
}
- return gUnknown_203B430;
+ return (struct MapTile*) gUnknown_203B430->unk0;
+}
+
+struct MapTile* GetMapTile_2(s32 x, s32 y)
+{
+ if (x < 0 || y < 0 || x >= DUNGEON_MAX_SIZE_X || y >= DUNGEON_MAX_SIZE_Y)
+ {
+ struct MapTile* tile = (struct MapTile*) gUnknown_202F190.unk0;
+ gUnknown_202F190 = *gUnknown_203B430;
+ return tile;
+ }
+ return gDungeonGlobalData->mapTilePointers[y][x];
}