Skip to content

Commit

Permalink
Update spoiler log and bits being set for scenes.
Browse files Browse the repository at this point in the history
This should fix the spoiler log revealing for temples.
  • Loading branch information
PhlexPlexico committed Jan 17, 2025
1 parent d3d9620 commit 4f3ccd5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
30 changes: 15 additions & 15 deletions code/source/rnd/gfx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,17 @@ namespace rnd {
-1,
-1,
-1,
GROUP_DUNGEON_WOODFALL_TEMPLE,
GROUP_DUNGEON_SNOWHEAD_TEMPLE,
GROUP_DUNGEON_GREAT_BAY,
GROUP_DUNGEON_STONE_TOWER,
GROUP_DUNGEON_PIRATE_FORTRESS,
GROUP_DUNGEON_BENEATH_THE_WELL,
GROUP_DUNGEON_IKANA_CASTLE,
GROUP_DUNGEON_SECRET_SHRINE,
GROUP_DUNGEON_THE_MOON,
GROUP_SWAMP_SKULLTULA_HOUSE,
GROUP_OCEAN_SKULLTULA_HOUSE,
DUNGEON_WOODFALL,
DUNGEON_SNOWHEAD,
DUNGEON_GREAT_BAY,
DUNGEON_STONE_TOWER,
-1,
-1,
-1,
-1,
-1,
-1,
-1,
};

static bool IsDungeonDiscovered(s8 dungeonId) {
Expand All @@ -77,22 +77,22 @@ namespace rnd {
}
// A dungeon is considered discovered if we've visited the dungeon or have the map,
//Check for Woodfall Temple Map
if (dungeonId == 0) {
if (dungeonId == DUNGEON_WOODFALL) {
hasMap = saveData.inventory.woodfall_dungeon_items.map.Value();
sceneId = 0x1B;
}
//Check for Snowhead Temple Map
else if (dungeonId == 1) {
else if (dungeonId == DUNGEON_SNOWHEAD) {
hasMap = saveData.inventory.snowhead_dungeon_items.map.Value();
sceneId = 0x21;
}
//Check for Great Bay Temple Map
else if (dungeonId == 2) {
else if (dungeonId == DUNGEON_GREAT_BAY) {
hasMap = saveData.inventory.great_bay_dungeon_items.map.Value();
sceneId = 0x49;
}
//Check for Stone Tower Temple Map
else if (dungeonId == 3) {
else if (dungeonId == DUNGEON_STONE_TOWER) {
hasMap = saveData.inventory.stone_tower_dungeon_items.map.Value();
sceneId = 0x16;
}
Expand Down
4 changes: 2 additions & 2 deletions code/source/rnd/savefile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,7 @@ namespace rnd {
u32 numBits = sizeof(u32) * 8;
u32 idx = sceneNum / numBits;
if (idx < SAVEFILE_SCENES_DISCOVERED_IDX_COUNT) {
u32 bit = 1 << (sceneNum - (idx * numBits));
u32 bit = 1 << abs(sceneNum - (idx * numBits));
return (gExtSaveData.scenesDiscovered[idx] & bit) != 0;
}
return 0;
Expand All @@ -857,7 +857,7 @@ namespace rnd {
u16 numBits = sizeof(u32) * 8;
u32 idx = sceneNum / numBits;
if (idx < SAVEFILE_SCENES_DISCOVERED_IDX_COUNT) {
u32 sceneBit = 1 << (sceneNum - (idx * numBits));
u32 sceneBit = 1 << abs(sceneNum - (idx * numBits));
gExtSaveData.scenesDiscovered[idx] |= sceneBit;
}
}
Expand Down

0 comments on commit 4f3ccd5

Please sign in to comment.