mirror of
https://github.com/zeldaret/tmc
synced 2026-09-03 02:13:43 -04:00
Fix dungeon item mixup
This commit is contained in:
@@ -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;
|
||||
|
||||
+3
-3
@@ -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)) {
|
||||
|
||||
+4
-6
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
+8
-8
@@ -721,17 +721,17 @@ void ScriptCommand_CheckInventory1(Entity* entity, ScriptExecutionContext* conte
|
||||
u32 tmp;
|
||||
u32 tmp2 = GetNextScriptCommandHalfwordAfterCommandMetadata(context->scriptInstructionPointer);
|
||||
switch (tmp2) {
|
||||
case 0x53:
|
||||
tmp = HasDungeonMap();
|
||||
case ITEM_SMALL_KEY:
|
||||
tmp = HasDungeonSmallKey();
|
||||
break;
|
||||
case 0x52:
|
||||
tmp = HasDungeonCompass();
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user