diff options
| author | notyourav <65437533+notyourav@users.noreply.github.com> | 2022-08-19 16:13:13 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-19 16:13:13 -0700 |
| commit | fd68e75a4debd804706f911b3abff75102ecccaa (patch) | |
| tree | 479aecde2a4ec02894df56f04ce347d1a91f3774 | |
| parent | 0cd2f4f86c9d8983111bfb2110b89d1788bca0ea (diff) | |
| parent | 715b1451431a79b531abed4be3f682909f2c6551 (diff) | |
Merge pull request #563 from Ibot02/sub_0801AFE4
| -rw-r--r-- | src/beanstalkSubtask.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/src/beanstalkSubtask.c b/src/beanstalkSubtask.c index b9bf1dc9..da5d39e8 100644 --- a/src/beanstalkSubtask.c +++ b/src/beanstalkSubtask.c @@ -34,7 +34,14 @@ extern const u16 gUnk_080B44A0[]; extern const u16 gUnk_080B4410[]; extern const s16 gUnk_080B4488[]; extern const s16 gUnk_080B44A8[]; -extern const u16 gUnk_080B44D0[]; + +typedef struct { + u16 unk0; + u16 unk1; +} struct_080B44D0; + +extern const struct_080B44D0 gUnk_080B44D0[]; + extern const u16* gUnk_080B4550[]; extern const u16 gUnk_080B77C0[]; extern BgAnimationFrame* gUnk_080B7278[]; @@ -594,8 +601,9 @@ void DeleteLoadedTileEntity(u32 position, s32 layer) { ptr[t] = ptr[count]; } +// used for minish houses, seems to overwrite all tiles on layer 1 for them? void sub_0801AFE4(void) { - const u16* ptr; + const struct_080B44D0* ptr; u8* collisionData; u32 x; u32 y; @@ -605,15 +613,17 @@ void sub_0801AFE4(void) { collisionData = gMapBottom.collisionData; width = gRoomControls.width >> 4; height = gRoomControls.height >> 4; - for (y = 0; y < height; collisionData = collisionData + (0x40 - width), y++) { - for (x = 0; x < width; collisionData++, x++) { - for (ptr = gUnk_080B44D0; ptr[0] != 0; ptr += 2) { - if (ptr[0] == *collisionData) { - SetTile(ptr[1], y * 0x40 + x, 1); + for (y = 0; y < height; y++) { + for (x = 0; x < width; x++) { + for (ptr = gUnk_080B44D0; ptr->unk0 != 0; ptr++) { + if (ptr->unk0 == *collisionData) { + SetTile(ptr->unk1, y * 0x40 + x, 1); break; } } + collisionData++; } + collisionData = collisionData + (0x40 - width); } } |
