mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-12 08:36:00 +01:00
Stacks check for invalid amounts (#91656)
## About The Pull Request Alleviates #91603 As in it does not fix it because i have not been able to reproduce it. It now checks for invalid values and defaults to `amount`(which is 1) during `Initialize()` and not null so we don't have to pass the number `1` when creating a single sheet. A stack trace is thrown for <= 0 sheet amounts so we can debug & fix stuff ## Changelog 🆑 code: stacks error on invalid amounts, removed manual passing of number `1` when creating a single stack in many cases /🆑
This commit is contained in:
@@ -66,9 +66,11 @@
|
||||
|
||||
/// Handles generating random numbers & calculating loot totals
|
||||
/obj/structure/closet/crate/secure/bitrunning/decrypted/proc/calculate_loot(reward_points, rewards_multiplier, ore_multiplier)
|
||||
PRIVATE_PROC(TRUE)
|
||||
|
||||
var/base = rewards_multiplier + reward_points
|
||||
var/random_sum = (rand() + 0.5) * base
|
||||
return ROUND_UP(random_sum * ore_multiplier)
|
||||
return max(ROUND_UP(random_sum * ore_multiplier), 1)
|
||||
|
||||
/// Handles spawning completion loot. This tries to handle bad flat and assoc lists
|
||||
/obj/structure/closet/crate/secure/bitrunning/decrypted/proc/spawn_loot(list/completion_loot)
|
||||
|
||||
Reference in New Issue
Block a user