mirror of
https://github.com/bdnugget/rs-sdk.git
synced 2026-11-07 09:07:30 +00:00
fix: validate Managing Miscellania coffers deposit and withdraw amounts
Clamp a deposit to the coins held as well as the coffer space, and ignore a withdraw count of 0 or less. Listed in server/PATCHES.md until LostCity ships its own fix.
This commit is contained in:
1 parent
2012ab67f6
commit
ca0fe09cc8
2 files changed
+9
-7
No files matched your search
@@ -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
|
||||
|
||||
+5
-7
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user