From 5006ebde14fe2e928d903ef97ca3f3503e2a5195 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 --- 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 df78026f987..aa4ecd007d5 100644 --- a/code/game/supplyshuttle.dm +++ b/code/game/supplyshuttle.dm @@ -171,12 +171,18 @@ var/list/mechtoys = list( if(processing) 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) @@ -496,7 +502,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
@@ -675,7 +680,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