Skip to content

Commit

Permalink
Merge pull request #2 from garrettjoecox/get-item-rework-help1
Browse files Browse the repository at this point in the history
Replace Randomizer_GetRandomizedItemId with Randomizer_GetRandomizedI…
  • Loading branch information
leggettc18 authored Aug 16, 2022
2 parents 6b4f300 + f874d83 commit 270c364
Show file tree
Hide file tree
Showing 48 changed files with 418 additions and 197 deletions.
4 changes: 3 additions & 1 deletion soh/include/functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,9 @@ u32 Actor_TextboxIsClosing(Actor* actor, GlobalContext* globalCtx);
s8 func_8002F368(GlobalContext* globalCtx);
void Actor_GetScreenPos(GlobalContext* globalCtx, Actor* actor, s16* x, s16* y);
u32 Actor_HasParent(Actor* actor, GlobalContext* globalCtx);
s32 GiveItemWithoutActor(GlobalContext* globalCtx, s32 getItemId);
s32 GiveItemEntryWithoutActor(GlobalContext* globalCtx, GetItemEntry getItemEntry);
s32 GiveItemEntryFromActor(Actor* actor, GlobalContext* globalCtx, GetItemEntry getItemEntry, f32 xzRange, f32 yRange);
void GiveItemEntryFromActorWithFixedRange(Actor* actor, GlobalContext* globalCtx, GetItemEntry getItemEntry);
s32 func_8002F434(Actor* actor, GlobalContext* globalCtx, s32 getItemId, f32 xzRange, f32 yRange);
void func_8002F554(Actor* actor, GlobalContext* globalCtx, s32 getItemId);
void func_8002F580(Actor* actor, GlobalContext* globalCtx);
Expand Down
22 changes: 2 additions & 20 deletions soh/soh/OTRGlobals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1618,15 +1618,6 @@ extern "C" GetItemEntry ItemTable_RetrieveEntry(s16 tableID, s16 getItemID) {
return ItemTableManager::Instance->RetrieveItemEntry(tableID, getItemID);
}

extern "C" s32 Randomizer_GetRandomizedItemId(GetItemID ogId, s16 actorId, s16 actorParams, s16 sceneNum) {
if (OTRGlobals::Instance->gRandomizer->CheckContainsVanillaItem(OTRGlobals::Instance->gRandomizer->GetCheckFromActor(sceneNum, actorId, actorParams))) {
OTRGlobals::Instance->getItemModIndex = MOD_NONE;
} else {
OTRGlobals::Instance->getItemModIndex = MOD_RANDOMIZER;
}
return OTRGlobals::Instance->gRandomizer->GetRandomizedItemId(ogId, actorId, actorParams, sceneNum);
}

extern "C" GetItemEntry Randomizer_GetRandomizedItem(GetItemID ogId, s16 actorId, s16 actorParams, s16 sceneNum) {
s16 getItemModIndex;
if (OTRGlobals::Instance->gRandomizer->CheckContainsVanillaItem(
Expand All @@ -1639,15 +1630,6 @@ extern "C" GetItemEntry Randomizer_GetRandomizedItem(GetItemID ogId, s16 actorId
return ItemTable_RetrieveEntry(getItemModIndex, itemID);
}

extern "C" s32 Randomizer_GetItemIdFromKnownCheck(RandomizerCheck randomizerCheck, GetItemID ogId) {
if (OTRGlobals::Instance->gRandomizer->CheckContainsVanillaItem(randomizerCheck)) {
OTRGlobals::Instance->getItemModIndex = MOD_NONE;
} else {
OTRGlobals::Instance->getItemModIndex = MOD_RANDOMIZER;
}
return OTRGlobals::Instance->gRandomizer->GetRandomizedItemIdFromKnownCheck(randomizerCheck, ogId);
}

extern "C" GetItemEntry Randomizer_GetItemFromKnownCheck(RandomizerCheck randomizerCheck, GetItemID ogId) {
s16 getItemModIndex;
if (OTRGlobals::Instance->gRandomizer->CheckContainsVanillaItem(randomizerCheck)) {
Expand All @@ -1661,11 +1643,11 @@ extern "C" GetItemEntry Randomizer_GetItemFromKnownCheck(RandomizerCheck randomi

extern "C" bool Randomizer_ObtainedFreestandingIceTrap(RandomizerCheck randomizerCheck, GetItemID ogId, Actor* actor) {
return gSaveContext.n64ddFlag && (actor->parent != NULL) &&
Randomizer_GetItemIdFromKnownCheck(randomizerCheck, ogId) == GI_ICE_TRAP;
Randomizer_GetItemFromKnownCheck(randomizerCheck, ogId).getItemId == RG_ICE_TRAP;
}

extern "C" bool Randomizer_ItemIsIceTrap(RandomizerCheck randomizerCheck, GetItemID ogId) {
return gSaveContext.n64ddFlag && Randomizer_GetItemIdFromKnownCheck(randomizerCheck, ogId) == GI_ICE_TRAP;
return gSaveContext.n64ddFlag && Randomizer_GetItemFromKnownCheck(randomizerCheck, ogId).getItemId == RG_ICE_TRAP;
}

extern "C" CustomMessageEntry Randomizer_GetCustomGetItemMessage(GetItemID giid, char* buffer, const int maxBufferSize) {
Expand Down
5 changes: 1 addition & 4 deletions soh/soh/OTRGlobals.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,7 @@ u8 Randomizer_GetSettingValue(RandomizerSettingKey randoSettingKey);
RandomizerCheck Randomizer_GetCheckFromActor(s16 actorId, s16 actorParams, s16 sceneNum);
void Randomizer_LoadHintLocations(const char* spoilerFileName);
void Randomizer_LoadItemLocations(const char* spoilerFileName, bool silent);
s16 Randomizer_GetItemModelFromId(s16 itemId);
s32 Randomizer_GetItemIDFromGetItemID(s32 getItemId);
s32 Randomizer_GetRandomizedItemId(GetItemID ogId, s16 actorId, s16 actorParams, s16 sceneNum);
s32 Randomizer_GetItemIdFromKnownCheck(RandomizerCheck randomizerCheck, GetItemID ogId);
s32 Randomizer_GetItemIDFromGetItemID(s32 getItemId); // TODO: Remove me
GetItemEntry Randomizer_GetRandomizedItem(GetItemID ogId, s16 actorId, s16 actorParams, s16 sceneNum);
GetItemEntry Randomizer_GetItemFromKnownCheck(RandomizerCheck randomizerCheck, GetItemID ogId);
bool Randomizer_ObtainedFreestandingIceTrap(RandomizerCheck randomizerCheck, GetItemID ogId, Actor* actor);
Expand Down
45 changes: 40 additions & 5 deletions soh/src/code/z_actor.c
Original file line number Diff line number Diff line change
Expand Up @@ -1955,15 +1955,16 @@ u32 Actor_HasParent(Actor* actor, GlobalContext* globalCtx) {
}
}

s32 GiveItemWithoutActor(GlobalContext* globalCtx, s32 getItemId) {
s32 GiveItemEntryWithoutActor(GlobalContext* globalCtx, GetItemEntry getItemEntry) {
Player* player = GET_PLAYER(globalCtx);

if (!(player->stateFlags1 & 0x3C7080) && Player_GetExplosiveHeld(player) < 0) {
if (((player->heldActor != NULL) && ((getItemId > GI_NONE) && (getItemId < GI_MAX)) ||
(gSaveContext.n64ddFlag && (getItemId > RG_NONE) && (getItemId < RG_MAX))) ||
if (((player->heldActor != NULL) && ((getItemEntry.getItemId > GI_NONE) && (getItemEntry.getItemId < GI_MAX)) ||
(gSaveContext.n64ddFlag && (getItemEntry.getItemId > RG_NONE) && (getItemEntry.getItemId < RG_MAX))) ||
(!(player->stateFlags1 & 0x20000800))) {
if ((getItemId != GI_NONE)) {
player->getItemId = getItemId;
if ((getItemEntry.getItemId != GI_NONE)) {
player->getItemEntry = getItemEntry;
player->getItemId = getItemEntry.getItemId;
player->interactRangeActor = &player->actor;
player->getItemDirection = player->actor.shape.rot.y;
return true;
Expand All @@ -1974,6 +1975,38 @@ s32 GiveItemWithoutActor(GlobalContext* globalCtx, s32 getItemId) {
return false;
}

s32 GiveItemEntryFromActor(Actor* actor, GlobalContext* globalCtx, GetItemEntry getItemEntry, f32 xzRange, f32 yRange) {
Player* player = GET_PLAYER(globalCtx);

if (!(player->stateFlags1 & 0x3C7080) && Player_GetExplosiveHeld(player) < 0) {
if ((((player->heldActor != NULL) || (actor == player->targetActor)) &&
((!gSaveContext.n64ddFlag && ((getItemEntry.getItemId > GI_NONE) && (getItemEntry.getItemId < GI_MAX))) ||
(gSaveContext.n64ddFlag && ((getItemEntry.getItemId > RG_NONE) && (getItemEntry.getItemId < RG_MAX))))) ||
(!(player->stateFlags1 & 0x20000800))) {
if ((actor->xzDistToPlayer < xzRange) && (fabsf(actor->yDistToPlayer) < yRange)) {
s16 yawDiff = actor->yawTowardsPlayer - player->actor.shape.rot.y;
s32 absYawDiff = ABS(yawDiff);

if ((getItemEntry.getItemId != GI_NONE) || (player->getItemDirection < absYawDiff)) {
player->getItemEntry = getItemEntry;
player->getItemId = getItemEntry.getItemId;
player->interactRangeActor = actor;
player->getItemDirection = absYawDiff;
return true;
}
}
}
}

return false;
}

void GiveItemEntryFromActorWithFixedRange(Actor* actor, GlobalContext* globalCtx, GetItemEntry getItemEntry) {
GiveItemEntryFromActor(actor, globalCtx, getItemEntry, 50.0f, 10.0f);
}

// TODO: Rename to GiveItemIdFromActor or similar
// If you're doing something for randomizer, you're probably looking for GiveItemEntryFromActor
s32 func_8002F434(Actor* actor, GlobalContext* globalCtx, s32 getItemId, f32 xzRange, f32 yRange) {
Player* player = GET_PLAYER(globalCtx);

Expand All @@ -1998,6 +2031,8 @@ s32 func_8002F434(Actor* actor, GlobalContext* globalCtx, s32 getItemId, f32 xzR
return false;
}

// TODO: Rename to GiveItemIdFromActorWithFixedRange or similar
// If you're doing something for randomizer, you're probably looking for GiveItemEntryFromActorWithFixedRange
void func_8002F554(Actor* actor, GlobalContext* globalCtx, s32 getItemId) {
func_8002F434(actor, globalCtx, getItemId, 50.0f, 10.0f);
}
Expand Down
21 changes: 15 additions & 6 deletions soh/src/code/z_en_item00.c
Original file line number Diff line number Diff line change
Expand Up @@ -512,8 +512,11 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
if ((gSaveContext.n64ddFlag || getItemId != GI_NONE) && !Actor_HasParent(&this->actor, globalCtx)) {
getItem = Randomizer_GetRandomizedItem(getItemId, this->actor.id, this->ogParams, globalCtx->sceneNum);
getItemId = getItem.getItemId;
func_8002F554(&this->actor, globalCtx, getItemId);
GET_PLAYER(globalCtx)->getItemEntry = getItem;
if (!gSaveContext.n64ddFlag) {
func_8002F554(&this->actor, globalCtx, getItemId);
} else {
GiveItemEntryFromActorWithFixedRange(&this->actor, globalCtx, getItem);
}
}

EnItem00_SetupAction(this, func_8001E5C8);
Expand Down Expand Up @@ -668,10 +671,15 @@ void func_8001E304(EnItem00* this, GlobalContext* globalCtx) {

void func_8001E5C8(EnItem00* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
GetItemEntry getItemEntry = Randomizer_GetRandomizedItem(this->getItemId, this->actor.id, this->ogParams, globalCtx->sceneNum);

if (this->getItemId != GI_NONE) {
if (!Actor_HasParent(&this->actor, globalCtx)) {
func_8002F434(&this->actor, globalCtx, this->getItemId, 50.0f, 80.0f);
if (!gSaveContext.n64ddFlag || getItemEntry.getItemId == GI_NONE) {
func_8002F434(&this->actor, globalCtx, getItemEntry.getItemId, 50.0f, 80.0f);
} else {
GiveItemEntryFromActor(&this->actor, globalCtx, getItemEntry, 50.0f, 80.0f);
}
this->unk_15A++;
} else {
this->getItemId = GI_NONE;
Expand Down Expand Up @@ -884,12 +892,13 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) {
params = &this->actor.params;

if ((getItemId != GI_NONE) && !Actor_HasParent(&this->actor, globalCtx)) {
if (gSaveContext.n64ddFlag) {
if (!gSaveContext.n64ddFlag) {
func_8002F554(&this->actor, globalCtx, getItemId);
} else {
getItem = Randomizer_GetRandomizedItem(getItemId, this->actor.id, this->ogParams, globalCtx->sceneNum);
GET_PLAYER(globalCtx)->getItemEntry = getItem;
getItemId = getItem.getItemId;
GiveItemEntryFromActorWithFixedRange(&this->actor, globalCtx, getItem);
}
func_8002F554(&this->actor, globalCtx, getItemId);
}

switch (*params) {
Expand Down
21 changes: 10 additions & 11 deletions soh/src/code/z_play.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ void GivePlayerRandoRewardSongOfTime(GlobalContext* globalCtx, RandomizerCheck c

if (gSaveContext.entranceIndex == 0x050F && player != NULL && !Player_InBlockingCsMode(globalCtx, player) &&
!Flags_GetTreasure(globalCtx, 0x1F) && gSaveContext.nextTransition == 0xFF) {
GetItemID getItemId = Randomizer_GetItemIdFromKnownCheck(check, RG_SONG_OF_TIME);
GiveItemWithoutActor(globalCtx, getItemId);
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(check, RG_SONG_OF_TIME);
GiveItemEntryWithoutActor(globalCtx, getItemEntry);
player->pendingFlag.flagID = 0x1F;
player->pendingFlag.flagType = FLAG_SCENE_TREASURE;
}
Expand All @@ -216,8 +216,8 @@ void GivePlayerRandoRewardNocturne(GlobalContext* globalCtx, RandomizerCheck che
gSaveContext.entranceIndex == 0x0195) && LINK_IS_ADULT && CHECK_QUEST_ITEM(QUEST_MEDALLION_FOREST) &&
CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE) && CHECK_QUEST_ITEM(QUEST_MEDALLION_WATER) && player != NULL &&
!Player_InBlockingCsMode(globalCtx, player) && !Flags_GetEventChkInf(0xAA)) {
GetItemID getItemId = Randomizer_GetItemIdFromKnownCheck(check, RG_NOCTURNE_OF_SHADOW);
GiveItemWithoutActor(globalCtx, getItemId);
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(check, RG_NOCTURNE_OF_SHADOW);
GiveItemEntryWithoutActor(globalCtx, getItemEntry);
Flags_SetEventChkInf(0xAA);
}
}
Expand All @@ -228,8 +228,8 @@ void GivePlayerRandoRewardRequiem(GlobalContext* globalCtx, RandomizerCheck chec
if ((gSaveContext.gameMode == 0) && (gSaveContext.respawnFlag <= 0) && (gSaveContext.cutsceneIndex < 0xFFF0)) {
if ((gSaveContext.entranceIndex == 0x01E1) && !Flags_GetEventChkInf(0xAC) && player != NULL &&
!Player_InBlockingCsMode(globalCtx, player)) {
GetItemID getItemId = Randomizer_GetItemIdFromKnownCheck(check, RG_SONG_OF_TIME);
GiveItemWithoutActor(globalCtx, getItemId);
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(check, RG_SONG_OF_TIME);
GiveItemEntryWithoutActor(globalCtx, getItemEntry);
Flags_SetEventChkInf(0xAC);
}
}
Expand All @@ -243,8 +243,7 @@ void GivePlayerRandoRewardZeldaLightArrowsGift(GlobalContext* globalCtx, Randomi
!Flags_GetTreasure(globalCtx, 0x1E) && player != NULL && !Player_InBlockingCsMode(globalCtx, player) &&
globalCtx->sceneLoadFlag == 0) {
GetItemEntry getItem = Randomizer_GetItemFromKnownCheck(check, GI_ARROW_LIGHT);
if (player->pendingFlag.flagType == FLAG_NONE && GiveItemWithoutActor(globalCtx, getItem.getItemId)) {
player->getItemEntry = getItem;
if (player->pendingFlag.flagType == FLAG_NONE && GiveItemEntryWithoutActor(globalCtx, getItem)) {
player->pendingFlag.flagID = 0x1E;
player->pendingFlag.flagType = FLAG_SCENE_TREASURE;
}
Expand All @@ -254,11 +253,11 @@ void GivePlayerRandoRewardZeldaLightArrowsGift(GlobalContext* globalCtx, Randomi
void GivePlayerRandoRewardSariaGift(GlobalContext* globalCtx, RandomizerCheck check) {
Player* player = GET_PLAYER(globalCtx);
if (gSaveContext.entranceIndex == 0x05E0) {
GetItemID getItemId = Randomizer_GetItemIdFromKnownCheck(check, RG_ZELDAS_LULLABY);
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(check, RG_ZELDAS_LULLABY);

if ((!Flags_GetEventChkInf(0xC1) || (player->getItemId == getItemId && getItemId != GI_ICE_TRAP)) &&
if ((!Flags_GetEventChkInf(0xC1) || (player->getItemId == getItemEntry.getItemId && getItemEntry.getItemId != GI_ICE_TRAP)) &&
player != NULL && !Player_InBlockingCsMode(globalCtx, player)) {
GiveItemWithoutActor(globalCtx, getItemId);
GiveItemEntryWithoutActor(globalCtx, getItemEntry);
Flags_SetEventChkInf(0xC1);
}
}
Expand Down
4 changes: 2 additions & 2 deletions soh/src/code/z_sram.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,9 +417,9 @@ void GiveLinkDungeonReward(uint16_t getItemId) {
}

void GiveLinksPocketMedallion() {
RandomizerGet getItemId = Randomizer_GetItemIdFromKnownCheck(RC_LINKS_POCKET, RG_NONE);
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_LINKS_POCKET, RG_NONE);

GiveLinkDungeonReward(getItemId);
GiveLinkDungeonReward(getItemEntry.getItemId);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions soh/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,14 @@ const ActorInit Bg_Dy_Yoseizo_InitVars = {

void GivePlayerRandoRewardGreatFairy(BgDyYoseizo* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
GetItemID getItemId = Randomizer_GetRandomizedItemId(GI_NONE, this->actor.id, this->fountainType + 1, globalCtx->sceneNum);
GetItemEntry getItemEntry = Randomizer_GetRandomizedItem(GI_NONE, this->actor.id, this->fountainType + 1, globalCtx->sceneNum);

if (this->actor.parent == GET_PLAYER(globalCtx) && !Flags_GetTreasure(globalCtx, this->fountainType + 1) &&
!Player_InBlockingCsMode(globalCtx, GET_PLAYER(globalCtx))) {
Flags_SetTreasure(globalCtx, this->fountainType + 1);
Actor_Kill(&this->actor);
} else if (!Flags_GetTreasure(globalCtx, this->fountainType + 1)) {
func_8002F434(&this->actor, globalCtx, getItemId, 10000.0f, 100.0f);
GiveItemEntryFromActor(&this->actor, globalCtx, getItemEntry, 10000.0f, 100.0f);
}
}

Expand Down
4 changes: 2 additions & 2 deletions soh/src/overlays/actors/ovl_Demo_Im/z_demo_im.c
Original file line number Diff line number Diff line change
Expand Up @@ -899,13 +899,13 @@ void func_80986BF8(DemoIm* this, GlobalContext* globalCtx) {
}

void GivePlayerRandoRewardImpa(Actor* impa, GlobalContext* globalCtx, RandomizerCheck check) {
GetItemID getItemId = Randomizer_GetItemIdFromKnownCheck(check, RG_ZELDAS_LULLABY);
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(check, RG_ZELDAS_LULLABY);

if (impa->parent != NULL && impa->parent->id == GET_PLAYER(globalCtx)->actor.id &&
!Flags_GetTreasure(globalCtx, 0x1F)) {
Flags_SetTreasure(globalCtx, 0x1F);
} else if (!Flags_GetTreasure(globalCtx, 0x1F) && !Randomizer_GetSettingValue(RSK_SKIP_CHILD_ZELDA)) {
func_8002F434(impa, globalCtx, getItemId, 75.0f, 50.0f);
GiveItemEntryFromActor(impa, globalCtx, getItemEntry, 75.0f, 50.0f);
} else if (!Player_InBlockingCsMode(globalCtx, GET_PLAYER(globalCtx))) {
gSaveContext.eventChkInf[5] |= 0x200;
globalCtx->sceneLoadFlag = 0x14;
Expand Down
4 changes: 2 additions & 2 deletions soh/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c
Original file line number Diff line number Diff line change
Expand Up @@ -462,13 +462,13 @@ s32 DoorWarp1_PlayerInRange(DoorWarp1* this, GlobalContext* globalCtx) {
}

void GivePlayerRandoReward(DoorWarp1* this, Player* player, GlobalContext* globalCtx, u8 ruto, u8 adult) {
GetItemID getItemId = Randomizer_GetRandomizedItemId(GI_NONE, this->actor.id, this->actor.params, globalCtx->sceneNum);
GetItemEntry getItemEntry = Randomizer_GetRandomizedItem(GI_NONE, this->actor.id, this->actor.params, globalCtx->sceneNum);

if (this->actor.parent != NULL && 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);
GiveItemEntryFromActor(&this->actor, globalCtx, getItemEntry, 10000.0f, 100.0f);
} else if (!Player_InBlockingCsMode(globalCtx, GET_PLAYER(globalCtx))) {
if (adult) {
OnePointCutscene_Init(globalCtx, 0x25E8, 999, &this->actor, MAIN_CAM);
Expand Down
16 changes: 8 additions & 8 deletions soh/src/overlays/actors/ovl_En_Ani/z_en_ani.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,11 @@ void func_809B0558(EnAni* this, GlobalContext* globalCtx) {
}
gSaveContext.itemGetInf[1] |= 0x20;
} else {
if (gSaveContext.n64ddFlag) {
s32 getItemId = Randomizer_GetItemIdFromKnownCheck(RC_KAK_MAN_ON_ROOF, GI_HEART_PIECE);
func_8002F434(&this->actor, globalCtx, getItemId, 10000.0f, 200.0f);
} else {
if (!gSaveContext.n64ddFlag) {
func_8002F434(&this->actor, globalCtx, GI_HEART_PIECE, 10000.0f, 200.0f);
} else {
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_KAK_MAN_ON_ROOF, GI_HEART_PIECE);
GiveItemEntryFromActor(&this->actor, globalCtx, getItemEntry, 10000.0f, 200.0f);
}
}
}
Expand All @@ -140,11 +140,11 @@ void func_809B05F0(EnAni* this, GlobalContext* globalCtx) {
EnAni_SetupAction(this, func_809B0558);
}

if (gSaveContext.n64ddFlag) {
s32 getItemId = Randomizer_GetItemIdFromKnownCheck(RC_KAK_MAN_ON_ROOF, GI_HEART_PIECE);
func_8002F434(&this->actor, globalCtx, getItemId, 10000.0f, 200.0f);
} else {
if (!gSaveContext.n64ddFlag) {
func_8002F434(&this->actor, globalCtx, GI_HEART_PIECE, 10000.0f, 200.0f);
} else {
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_KAK_MAN_ON_ROOF, GI_HEART_PIECE);
GiveItemEntryFromActor(&this->actor, globalCtx, getItemEntry, 10000.0f, 200.0f);
}
}

Expand Down
Loading

0 comments on commit 270c364

Please sign in to comment.