fixed warps

This commit is contained in:
MelonSpeedruns 2022-05-31 21:56:15 -04:00
commit 1f40042e8f

View file

@ -461,11 +461,14 @@ s32 DoorWarp1_PlayerInRange(DoorWarp1* this, GlobalContext* globalCtx) {
return ret;
}
u8 successWarp = 0;
void GivePlayerRandoReward(DoorWarp1* this, Player* player, GlobalContext* globalCtx, u8 ruto, u8 adult) {
GetItemID getItemId = GetRandomizedItemId(GI_NONE, this->actor.id, this->actor.params, globalCtx->sceneNum);
if (successWarp && !Player_InBlockingCsMode(globalCtx, GET_PLAYER(globalCtx))) {
if (this->actor.parent->id == GET_PLAYER(globalCtx)->actor.id && !Flags_GetTreasure(globalCtx, 0x1F)) {
Flags_SetTreasure(globalCtx, 0x1F);
} else if (!Flags_GetTreasure(globalCtx, 0x1F)) {
func_8002F434(&this->actor, globalCtx, getItemId, 10000.0f, 100.0f);
} else if (!Player_InBlockingCsMode(globalCtx, GET_PLAYER(globalCtx))) {
if (adult) {
OnePointCutscene_Init(globalCtx, 0x25E8, 999, &this->actor, MAIN_CAM);
func_8002DF54(globalCtx, &this->actor, 10);
@ -492,10 +495,6 @@ void GivePlayerRandoReward(DoorWarp1* this, Player* player, GlobalContext* globa
DoorWarp1_SetupAction(this, DoorWarp1_ChildWarpOut);
}
}
successWarp = 0;
} else if (!successWarp) {
successWarp = func_8002F434(&this->actor, globalCtx, getItemId, 10000.0f, 100.0f);
}
}