From e024ef3876b4172459f2ddd13b3273fcd7035497 Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Thu, 25 Sep 2014 18:28:14 +0930 Subject: [PATCH] Fixes #6401 --- code/game/machinery/vending.dm | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm index 17389d93f87..537454477c3 100644 --- a/code/game/machinery/vending.dm +++ b/code/game/machinery/vending.dm @@ -20,11 +20,11 @@ layer = 2.9 anchored = 1 density = 1 - + use_power = 1 idle_power_usage = 10 var/vend_power_usage = 150 //actuators and stuff - + var/active = 1 //No sales pitches if off! var/delay_product_spawn // If set, uses sleep() in product spawn proc (mostly for seeds to retrieve correct names). var/vend_ready = 1 //Are we ready to vend?? Is it time?? @@ -115,6 +115,10 @@ return /obj/machinery/vending/proc/build_inventory(var/list/productlist,hidden=0,req_coin=0) + + if(delay_product_spawn) + sleep(15) //Make ABSOLUTELY SURE the seed datum is properly populated. + for(var/typepath in productlist) var/amount = productlist[typepath] var/price = prices[typepath] @@ -139,10 +143,9 @@ product_records += R if(delay_product_spawn) - sleep(1) - R.product_name = temp.name - else - R.product_name = temp.name + sleep(5) //sleep(1) did not seem to cut it, so here we are. + + R.product_name = temp.name // world << "Added: [R.product_name]] - [R.amount] - [R.product_path]" return