Merge pull request #73 from kadeski/fix/misc-coffers-input

fix: validate Managing Miscellania coffers deposit and withdraw amounts
This commit is contained in:
Max Bittker authored and GitHub committed 2026-10-11 19:36:36 -04:00
commit e4441c6233
2 files changed
+9 -7

No files matched your search

+4
View File
@@ -373,6 +373,10 @@ Upgrade hazards:
- [ ] **`scripts/login_logout/login.rs2`** — random-event timer gated on `map_random_events`.
- [ ] **`scripts/macro events/scripts/macro_events.rs2`** — macro events disabled when off.
- [ ] **`scripts/shop/configs/shop.varp`** — `transmit=yes` on shop varps (bot shop state).
- [ ] **`scripts/minigames/game_managing_miscellania/scripts/managing_miscellania.rs2`** — coffers
deposit clamps to `min(requested, coffer space, coins held)`; withdraw returns on a count of
0 or less. Reported upstream to LostCity; drop this patch once their 289 branch carries a fix.
Verify: `grep -n "withdraw_amt <= 0" scripts/minigames/game_managing_miscellania/scripts/managing_miscellania.rs2`
- [x] **README art** — moved out of the vendored tree to `docs/media/` (promo.gif, discord.svg,
hiscores.svg, task_length.svg); nothing in `content/title/` is locally modified anymore.
- [ ] Smithing arrowheads + telegrab + nails fixes live in content history; they're additive
@@ -98,13 +98,7 @@ def_int $requested_deposit = last_int;
if_close;
p_delay(0);
def_int $coffer_space = sub(5000000, %misc_coffers);
def_int $deposit_amt = $requested_deposit;
if ($deposit_amt > $coffer_space) {
$deposit_amt = $coffer_space;
} else if($deposit_amt > $inv_coins) {
$deposit_amt = $inv_coins;
}
def_int $deposit_amt = min($requested_deposit, min($coffer_space, $inv_coins));
if ($deposit_amt > 0) {
inv_del(inv, coins, $deposit_amt);
@@ -132,6 +126,10 @@ p_countdialog;
def_int $withdraw_amt = last_int;
if_close;
p_delay(0);
if ($withdraw_amt <= 0) {
~open_manage_miscellania_interface;
return;
}
if ($withdraw_amt > %misc_coffers) {
$withdraw_amt = %misc_coffers;
}