mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-12 11:13:16 +00:00
Merge pull request #3303 from CHOMPStation2/upstream-merge-11964
[MIRROR] Fixes produce persistence
This commit is contained in:
@@ -52,11 +52,11 @@
|
|||||||
// Delete some stacks if we want
|
// Delete some stacks if we want
|
||||||
if(stacks_go_missing)
|
if(stacks_go_missing)
|
||||||
var/fuzzy = rand(55,65)*0.01 // loss of 35-45% with rounding down
|
var/fuzzy = rand(55,65)*0.01 // loss of 35-45% with rounding down
|
||||||
count = round(count*fuzzy)
|
count = round(count*fuzzy)
|
||||||
if(count <= 0)
|
if(count <= 0)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
while(count > 0)
|
while(count > 0)
|
||||||
inst = new real_path(null, min(count, max_amount))
|
inst = new real_path(null, min(count, max_amount))
|
||||||
count -= inst.get_amount()
|
count -= inst.get_amount()
|
||||||
. += inst
|
. += inst
|
||||||
@@ -72,6 +72,16 @@
|
|||||||
name = "fruit storage lossy"
|
name = "fruit storage lossy"
|
||||||
go_missing_chance = 12.5 // 10% loss between rounds
|
go_missing_chance = 12.5 // 10% loss between rounds
|
||||||
|
|
||||||
|
/datum/persistent/storage/smartfridge/produce/generate_items(var/list/L) // Mostly same as storage/generate_items() but without converting string to path
|
||||||
|
. = list()
|
||||||
|
for(var/fruit_type in L)
|
||||||
|
for(var/i in 1 to L[fruit_type])
|
||||||
|
if(prob(go_missing_chance))
|
||||||
|
continue
|
||||||
|
var/atom/A = create_item(fruit_type)
|
||||||
|
if(!QDELETED(A))
|
||||||
|
. += A
|
||||||
|
|
||||||
/datum/persistent/storage/smartfridge/produce/create_item(var/seedtype)
|
/datum/persistent/storage/smartfridge/produce/create_item(var/seedtype)
|
||||||
return new /obj/item/weapon/reagent_containers/food/snacks/grown(null, seedtype) // Smartfridge will be stock()ed with it, loc is unimportant
|
return new /obj/item/weapon/reagent_containers/food/snacks/grown(null, seedtype) // Smartfridge will be stock()ed with it, loc is unimportant
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user