Randomizer: Fixes LACS and Prelude checks under certain conditions (#961)

* Prevents LACS flag from getting set when it shouldn't be.

* Fixes Prelude and LACS checks so they apply immediately if missed.

* Refactors the scene-flag-setting code into its own function.

* Renames new enums and props to be clearer and not specific to scene flags.

* Refactors pendingFlag data into a separate struct.
This commit is contained in:
Christopher Leggett 2022-07-31 21:57:30 -04:00 committed by GitHub
parent 8c25e9a992
commit b59c9cdf02
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 51 additions and 6 deletions

View file

@ -237,10 +237,11 @@ void GivePlayerRandoRewardZeldaLightArrowsGift(GlobalContext* globalCtx, Randomi
if (CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT) && CHECK_QUEST_ITEM(QUEST_MEDALLION_SHADOW) && LINK_IS_ADULT &&
(gEntranceTable[((void)0, gSaveContext.entranceIndex)].scene == SCENE_TOKINOMA) &&
!Flags_GetTreasure(globalCtx, 0x1E) && player != NULL && !Player_InBlockingCsMode(globalCtx, player) &&
globalCtx->sceneLoadFlag == 0 && player->getItemId == GI_NONE) {
globalCtx->sceneLoadFlag == 0) {
GetItemID getItemId = Randomizer_GetItemIdFromKnownCheck(check, GI_ARROW_LIGHT);
GiveItemWithoutActor(globalCtx, getItemId);
Flags_SetTreasure(globalCtx, 0x1E);
player->pendingFlag.flagID = 0x1E;
player->pendingFlag.flagType = FLAG_SCENE_TREASURE;
}
}