Fix bug with uncollected silver rupees getting killed when room is cleared.
This commit is contained in:
parent
4a25a07a72
commit
f02cb56d0c
|
@ -1194,6 +1194,10 @@ void RegisterSilverRupeeShuffle() {
|
|||
if (actor->id == ACTOR_EN_G_SWITCH) {
|
||||
auto* silverRupee = reinterpret_cast<EnGSwitch*>(actor);
|
||||
if (silverRupee->type == ENGSWITCH_SILVER_RUPEE) {
|
||||
// Override any Actor_Kill calls from the vanilla silver rupee init function.
|
||||
silverRupee->actor.update = EnGSwitch_Update;
|
||||
silverRupee->actor.flags = ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED;
|
||||
Actor_SetScale(&silverRupee->actor, 0.03f);
|
||||
Rando::Position randoPos = {static_cast<SceneID>(gPlayState->sceneNum), ResourceMgr_IsSceneMasterQuest(gPlayState->sceneNum) ? RCQUEST_MQ : RCQUEST_VANILLA, actor->world.pos};
|
||||
silverRupee->rc = Rando::StaticData::silverRupeeMap.at(randoPos);
|
||||
Rando::Location* loc = Rando::StaticData::GetLocation(silverRupee->rc);
|
||||
|
|
|
@ -8,6 +8,14 @@ struct EnGSwitch;
|
|||
|
||||
typedef void (*EnGSwitchActionFunc)(struct EnGSwitch*, PlayState*);
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
void EnGSwitch_Update(Actor* thisx, PlayState* play);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ GSWITCH_NONE,
|
||||
/* 1 */ GSWITCH_APPEAR,
|
||||
|
|
Loading…
Reference in New Issue