From 257cc41d2b537e4a1ef2e6dd0cf6907380abf46d Mon Sep 17 00:00:00 2001 From: Josh Bodner <30329717+jbodner09@users.noreply.github.com> Date: Thu, 9 Jun 2022 14:28:58 -0700 Subject: [PATCH] Stop the dropped item despawn timer on demand (#382) * Stop the despawn timer on demand * But do make them disappear once they're collected! --- libultraship/libultraship/SohImGuiImpl.cpp | 2 ++ soh/src/code/z_en_item00.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/libultraship/libultraship/SohImGuiImpl.cpp b/libultraship/libultraship/SohImGuiImpl.cpp index f6e41fb6e..f17a269be 100644 --- a/libultraship/libultraship/SohImGuiImpl.cpp +++ b/libultraship/libultraship/SohImGuiImpl.cpp @@ -1053,6 +1053,8 @@ namespace SohImGui { Tooltip("Allows you to use any item at any location"); EnhancementCheckbox("Freeze Time", "gFreezeTime"); Tooltip("Freezes the time of day"); + EnhancementCheckbox("Drops Don't Despawn", "gDropsDontDie"); + Tooltip("Drops from enemies, grass, etc. don't disappear after a set amount of time"); EnhancementCheckbox("Fireproof Deku Shield", "gFireproofDekuShield"); Tooltip("Prevents the Deku Shield from burning on contact with fire"); diff --git a/soh/src/code/z_en_item00.c b/soh/src/code/z_en_item00.c index d0179a5e1..a7de67900 100644 --- a/soh/src/code/z_en_item00.c +++ b/soh/src/code/z_en_item00.c @@ -896,6 +896,9 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) { if (this->unk_15A > 0) { this->unk_15A--; + if (CVar_GetS32("gDropsDontDie", 0) && (this->unk_154 <= 0)) { + this->unk_15A++; + } } if ((this->unk_15A > 0) && (this->unk_15A < 41) && (this->unk_154 <= 0)) {