From 175c48240d3ba936e60f0b5c2c0249bbb94dd306 Mon Sep 17 00:00:00 2001 From: mwerezak Date: Wed, 18 Jun 2014 21:24:57 -0400 Subject: [PATCH] Makes the supply shuttle process in a tighter loop Conflicts: code/game/supplyshuttle.dm --- code/game/supplyshuttle.dm | 17 +++++++++++------ code/modules/shuttles/shuttle_supply.dm | 6 ++++++ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/code/game/supplyshuttle.dm b/code/game/supplyshuttle.dm index d0ae877e4db..1d19f0c7c88 100644 --- a/code/game/supplyshuttle.dm +++ b/code/game/supplyshuttle.dm @@ -172,12 +172,18 @@ var/list/mechtoys = list( iteration++ points += points_per_process - var/datum/shuttle/ferry/supply/shuttle = get_shuttle() - if (shuttle) - shuttle.process_shuttle() - sleep(processing_interval) + spawn(0) + set background = 1 + while(1) + if(processing) + var/datum/shuttle/ferry/supply/shuttle = get_shuttle() + if (shuttle && shuttle.in_use) + shuttle.process_shuttle() + + sleep(10) + //To stop things being sent to centcomm which should not be sent to centcomm. Recursively checks for these types. proc/forbidden_atoms_check(atom/A) if(istype(A,/mob/living)) @@ -498,7 +504,6 @@ var/list/mechtoys = list( dat += {"
\nSupply points: [supply_controller.points]
\n
-// [shuttle.at_station() ? "\n*Must be away to order items*
\n
":"\nOrder items
\n
"] \nOrder items
\n
\nView requests
\n
\nView orders
\n
@@ -677,7 +682,7 @@ var/list/mechtoys = list( temp = "Current requests:

" for(var/S in supply_controller.requestlist) var/datum/supply_order/SO = S - temp += "#[SO.ordernum] - [SO.object.name] requested by [SO.orderedby] [shuttle.idle() ? "":shuttle.at_station() ? "":"Approve Remove"]
" + temp += "#[SO.ordernum] - [SO.object.name] requested by [SO.orderedby] Approve Remove
" temp += "
Clear list" temp += "
OK" diff --git a/code/modules/shuttles/shuttle_supply.dm b/code/modules/shuttles/shuttle_supply.dm index fedcc9efa77..f75193ea032 100644 --- a/code/modules/shuttles/shuttle_supply.dm +++ b/code/modules/shuttles/shuttle_supply.dm @@ -6,6 +6,8 @@ /datum/shuttle/ferry/supply var/away_location = 1 //the location to hide at while pretending to be in-transit var/arrive_time = 0 + var/late_chance = 80 + var/max_late_time = 300 /datum/shuttle/ferry/supply/short_jump(var/area/origin,var/area/destination) if(moving_status != SHUTTLE_IDLE) @@ -47,6 +49,10 @@ if (destination != away_area) move(away_area, destination) + //late + if (prob(late_chance)) + sleep(rand(0,max_late_time)) + moving_status = SHUTTLE_IDLE if (!at_station()) //at centcom