Skip to content

Commit

Permalink
Fix crashing with lens of truth checks
Browse files Browse the repository at this point in the history
  • Loading branch information
PhlexPlexico committed Feb 26, 2024
1 parent bd7103a commit d965c90
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion code/source/rnd/item_override.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,10 @@ namespace rnd {
return givenItems.enBoss02GivenItem ? (int) currentItem
: (int)0xFF;
} else if (currentItem == game::ItemId::LensOfTruth) {
auto* gctx = GetContext().gctx;
auto* gctx = rnd::GetContext().gctx;
if (!gctx || gctx->type != game::StateType::Play) {
return game::HasItem(currentItem) ? (int) currentItem : 0xFF;
}
if (gctx->scene == game::SceneId::GoronVillageWinter) {
auto& saveData = game::GetCommonData().save;
if (saveData.player.magic_acquired == 0 || !game::HasItem(currentItem)) return 0xFF;
Expand Down

0 comments on commit d965c90

Please sign in to comment.