diff options
| author | Catobat <69204835+Catobat@users.noreply.github.com> | 2023-04-24 16:31:06 +0200 |
|---|---|---|
| committer | Catobat <69204835+Catobat@users.noreply.github.com> | 2023-04-24 16:31:06 +0200 |
| commit | e59630f2022059add2723949fbe38d7ae000bd43 (patch) | |
| tree | 4f67fcae7543626bfada8ea34958e07cb990e658 /src | |
| parent | 7e4466f92831c1ad1ced59d14f0347d02f561a5e (diff) | |
Fix dungeon item mixup
Diffstat (limited to 'src')
| -rw-r--r-- | src/beanstalkSubtask.c | 2 | ||||
| -rw-r--r-- | src/common.c | 6 | ||||
| -rw-r--r-- | src/gameUtils.c | 10 | ||||
| -rw-r--r-- | src/menu/pauseMenu.c | 6 | ||||
| -rw-r--r-- | src/script.c | 16 |
5 files changed, 19 insertions, 21 deletions
diff --git a/src/beanstalkSubtask.c b/src/beanstalkSubtask.c index d09ea3cd..42f6943b 100644 --- a/src/beanstalkSubtask.c +++ b/src/beanstalkSubtask.c @@ -332,7 +332,7 @@ u32 UpdatePlayerCollision(void) { OpenSmallChest(position, gPlayerEntity.collisionLayer); return 2; case 0x71: - if (HasDungeonMap() == 0) { + if (HasDungeonSmallKey() == 0) { return 0; } gUnk_0200AF00.unk_2d = 6; diff --git a/src/common.c b/src/common.c index 64543bd9..d55dbf54 100644 --- a/src/common.c +++ b/src/common.c @@ -444,7 +444,7 @@ void DrawDungeonMap(u32 floor, DungeonMapObject* specialData, u32 size) { floorMapData++; } else { flagBankOffset = sub_0801DF10(floorMapData); - if (HasDungeonBigKey()) { + if (HasDungeonCompass()) { while (tileEntity->type != 0) { switch (tileEntity->type) { case SMALL_CHEST: @@ -468,7 +468,7 @@ void DrawDungeonMap(u32 floor, DungeonMapObject* specialData, u32 size) { tileEntity++; } } - if ((HasDungeonBigKey() && ((floorMapData->unk_2 & 2) != 0)) && (!CheckGlobalFlag(gArea.dungeon_idx + 1))) { + if ((HasDungeonCompass() && ((floorMapData->unk_2 & 2) != 0)) && (!CheckGlobalFlag(gArea.dungeon_idx + 1))) { roomHeader = gAreaRoomHeaders[floorMapData->area] + floorMapData->room; specialData->type = DMO_TYPE_BOSS; tmp1 = ((roomHeader->pixel_width / 2) + roomHeader->map_x) / 16; @@ -536,7 +536,7 @@ void DrawDungeonFeatures(u32 floor, void* data, u32 size) { if (layout->area == gUI.roomControls.area && layout->room == gUI.roomControls.room) { features = 8; } else { - if (HasDungeonSmallKey()) { + if (HasDungeonMap()) { features = 2; } if (IsRoomVisited(tileEntity, bankOffset)) { diff --git a/src/gameUtils.c b/src/gameUtils.c index 4f615950..8f9e9ace 100644 --- a/src/gameUtils.c +++ b/src/gameUtils.c @@ -243,7 +243,7 @@ bool32 AreaHasKeys(void) { return (gArea.areaMetadata >> 1) & 1; } -bool32 HasDungeonMap(void) { +bool32 HasDungeonSmallKey(void) { u32 tmp; if (AreaHasKeys()) @@ -251,7 +251,7 @@ bool32 HasDungeonMap(void) { return tmp ? 1 : 0; } -bool32 HasDungeonCompass(void) { +bool32 HasDungeonBigKey(void) { u32 tmp; if (AreaHasKeys()) @@ -259,15 +259,13 @@ bool32 HasDungeonCompass(void) { return tmp ? 1 : 0; } -bool32 HasDungeonBigKey(void) { +bool32 HasDungeonCompass(void) { if (!AreaHasKeys()) return 0; return (gSave.dungeonItems[gArea.dungeon_idx] >> 1) & 1; } -bool32 HasDungeonSmallKey(void) { - u32 tmp; - +bool32 HasDungeonMap(void) { if (!AreaHasKeys()) return 0; return gSave.dungeonItems[gArea.dungeon_idx] & 1; diff --git a/src/menu/pauseMenu.c b/src/menu/pauseMenu.c index 0b76815b..c36dbb9a 100644 --- a/src/menu/pauseMenu.c +++ b/src/menu/pauseMenu.c @@ -1153,17 +1153,17 @@ void sub_080A5D1C(void) { DrawDirect(DRAW_DIRECT_SPRITE_INDEX, (gMain.ticks & 0x20) != 0 ? 0x78 : 0x79); gOamCmd.y = 0x7e; gOamCmd._8 = 0x4380; - if (HasDungeonSmallKey()) { + if (HasDungeonMap()) { gOamCmd.x = 0x18; frameIndex = gSpriteAnimations_322[0x50]->index; DrawDirect(SUB_080A5D1C_SPRITE_INDEX, frameIndex); } - if (HasDungeonCompass()) { + if (HasDungeonBigKey()) { gOamCmd.x = 0x2e; frameIndex = gSpriteAnimations_322[0x52]->index; DrawDirect(SUB_080A5D1C_SPRITE_INDEX, frameIndex); } - if (HasDungeonBigKey()) { + if (HasDungeonCompass()) { gOamCmd.x = 0x45; gOamCmd._8 = 0x380; frameIndex = gSpriteAnimations_322[0x51]->index; diff --git a/src/script.c b/src/script.c index 1f14de5f..91bc5e95 100644 --- a/src/script.c +++ b/src/script.c @@ -721,17 +721,17 @@ void ScriptCommand_CheckInventory1(Entity* entity, ScriptExecutionContext* conte u32 tmp; u32 tmp2 = GetNextScriptCommandHalfwordAfterCommandMetadata(context->scriptInstructionPointer); switch (tmp2) { - case 0x53: - tmp = HasDungeonMap(); - break; - case 0x52: - tmp = HasDungeonCompass(); + case ITEM_SMALL_KEY: + tmp = HasDungeonSmallKey(); break; - case 0x51: + case ITEM_BIG_KEY: tmp = HasDungeonBigKey(); break; - case 0x50: - tmp = HasDungeonSmallKey(); + case ITEM_COMPASS: + tmp = HasDungeonCompass(); + break; + case ITEM_DUNGEON_MAP: + tmp = HasDungeonMap(); break; default: tmp = GetInventoryValue(tmp2); |
