summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGarrett Cox <garrettjcox@gmail.com>2026-07-25 09:35:00 -0500
committerGitHub <noreply@github.com>2026-07-25 10:35:00 -0400
commitcb0bab40d4f2fa497f1e3ece65df25e92dd50203 (patch)
treeaae72779d94c5e70affdef473ecd2a2f5812f98d
parentf11371f75e3a2f252a14d253311bd291b2110863 (diff)
Fix static trap models leaking, and shop items not converting junk (#1811)
Co-authored-by: Eblo <7004497+Eblo@users.noreply.github.com>
-rw-r--r--mm/2s2h/Rando/ActorBehavior/EnGirlA.cpp5
-rw-r--r--mm/2s2h/Rando/ConvertItem.cpp2
2 files changed, 6 insertions, 1 deletions
diff --git a/mm/2s2h/Rando/ActorBehavior/EnGirlA.cpp b/mm/2s2h/Rando/ActorBehavior/EnGirlA.cpp
index 9da237c37..51800b327 100644
--- a/mm/2s2h/Rando/ActorBehavior/EnGirlA.cpp
+++ b/mm/2s2h/Rando/ActorBehavior/EnGirlA.cpp
@@ -75,11 +75,14 @@ s32 EnGirlA_RandoCanBuyFunc(PlayState* play, EnGirlA* enGirlA) {
void EnGirlA_RandoBuyFunc(PlayState* play, EnGirlA* enGirlA) {
auto& randoSaveCheck = RANDO_SAVE_CHECKS[enGirlA->actor.world.rot.z];
- RandoItemId randoItemId = Rando::ConvertItem(randoSaveCheck.randoItemId, (RandoCheckId)enGirlA->actor.world.rot.z);
+ RandoCheckId randoCheckId = (RandoCheckId)enGirlA->actor.world.rot.z;
+ RandoItemId randoItemId = Rando::ConvertItem(randoSaveCheck.randoItemId, randoCheckId);
randoSaveCheck.obtained = randoSaveCheck.cycleObtained = true;
Rupees_ChangeBy(-play->msgCtx.unk1206C);
if (randoItemId == RI_TRAP) {
RollTrapType();
+ } else if (randoItemId == RI_JUNK) {
+ randoItemId = Rando::CurrentJunkItem(randoCheckId);
}
Rando::GiveItem(randoItemId);
}
diff --git a/mm/2s2h/Rando/ConvertItem.cpp b/mm/2s2h/Rando/ConvertItem.cpp
index 13fc338d4..27a811764 100644
--- a/mm/2s2h/Rando/ConvertItem.cpp
+++ b/mm/2s2h/Rando/ConvertItem.cpp
@@ -146,6 +146,8 @@ static RegisterShipInitFunc refreshInitFunc(
RefreshObtainableTrapItems();
});
+ allTrapItems.clear();
+
if (IS_RANDO) {
for (auto& [randoCheckId, _] : Rando::StaticData::Checks) {
RandoSaveCheck saveCheck = RANDO_SAVE_CHECKS[randoCheckId];