Supply shuttle and crate fixes

- Supply point generation no longer increases over time, leading to a total of around 45000 points generating after 150 minutes
- Supply packs can have access set as either a number or a list; either is transferred to crates' req_access var correctly
- Non-secure reagent cartridge crates no longer use secure crates
- Closet/crate examine now calls ..() in all circumstances, not just when the user is more than one tile away
- Possibly more I can't remember
This commit is contained in:
GinjaNinja32
2015-05-23 16:15:04 +01:00
parent 7c451f4e02
commit 3fb3a18f05
3 changed files with 27 additions and 32 deletions

View File

@@ -37,10 +37,7 @@
/obj/structure/closet/examine(mob/user) /obj/structure/closet/examine(mob/user)
if(get_dist(src, user) > 1) if(..(user, 1) && !opened)
return ..(user)
if(opened)
var/content_size = 0 var/content_size = 0
for(var/obj/item/I in src.contents) for(var/obj/item/I in src.contents)
if(!I.anchored) if(!I.anchored)

View File

@@ -123,9 +123,6 @@ var/list/mechtoys = list(
var/comment = null var/comment = null
/datum/controller/supply /datum/controller/supply
var/processing = 1
var/processing_interval = 300
var/iteration = 0
//supply points //supply points
var/points = 50 var/points = 50
var/points_per_process = 1 var/points_per_process = 1
@@ -145,20 +142,14 @@ var/list/mechtoys = list(
New() New()
ordernum = rand(1,9000) ordernum = rand(1,9000)
//Supply shuttle ticker - handles supply point regenertion and shuttle travelling between centcomm and the station
proc/process()
for(var/typepath in (typesof(/datum/supply_packs) - /datum/supply_packs)) for(var/typepath in (typesof(/datum/supply_packs) - /datum/supply_packs))
var/datum/supply_packs/P = new typepath() var/datum/supply_packs/P = new typepath()
supply_packs[P.name] = P supply_packs[P.name] = P
spawn(0) // Supply shuttle ticker - handles supply point regeneration
set background = 1 // This is called by the process scheduler every thirty seconds
while(1) proc/process()
if(processing) points += points_per_process
iteration++
points += points_per_process
sleep(processing_interval)
//To stop things being sent to centcomm which should not be sent to centcomm. Recursively checks for these types. //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) proc/forbidden_atoms_check(atom/A)
@@ -251,23 +242,30 @@ var/list/mechtoys = list(
var/datum/supply_order/SO = S var/datum/supply_order/SO = S
var/datum/supply_packs/SP = SO.object var/datum/supply_packs/SP = SO.object
var/atom/A = new SP.containertype(pickedloc) var/obj/A = new SP.containertype(pickedloc)
A.name = "[SP.containername] [SO.comment ? "([SO.comment])":"" ]" A.name = "[SP.containername] [SO.comment ? "([SO.comment])":"" ]"
//supply manifest generation begin //supply manifest generation begin
var/obj/item/weapon/paper/manifest/slip = new /obj/item/weapon/paper/manifest(A) var/obj/item/weapon/paper/manifest/slip
slip.is_copy = 0 if(!SP.contraband)
slip.info = "<h3>[command_name()] Shipping Manifest</h3><hr><br>" slip = new /obj/item/weapon/paper/manifest(A)
slip.info +="Order #[SO.ordernum]<br>" slip.is_copy = 0
slip.info +="Destination: [station_name]<br>" slip.info = "<h3>[command_name()] Shipping Manifest</h3><hr><br>"
slip.info +="[shoppinglist.len] PACKAGES IN THIS SHIPMENT<br>" slip.info +="Order #[SO.ordernum]<br>"
slip.info +="CONTENTS:<br><ul>" slip.info +="Destination: [station_name]<br>"
slip.info +="[shoppinglist.len] PACKAGES IN THIS SHIPMENT<br>"
slip.info +="CONTENTS:<br><ul>"
//spawn the stuff, finish generating the manifest while you're at it //spawn the stuff, finish generating the manifest while you're at it
if(SP.access) if(SP.access)
A:req_access = list() if(isnum(SP.access))
A:req_access += text2num(SP.access) A.req_access = list(SP.access)
else if(islist(SP.access))
var/list/L = SP.access // access var is a plain var, we need a list
A.req_access = L.Copy()
else
world << "<span class='danger'>Supply pack with invalid access restriction [SP.access] encountered!</span>"
var/list/contains var/list/contains
if(istype(SP,/datum/supply_packs/randomised)) if(istype(SP,/datum/supply_packs/randomised))
@@ -283,12 +281,12 @@ var/list/mechtoys = list(
if(!typepath) continue if(!typepath) continue
var/atom/B2 = new typepath(A) var/atom/B2 = new typepath(A)
if(SP.amount && B2:amount) B2:amount = SP.amount if(SP.amount && B2:amount) B2:amount = SP.amount
slip.info += "<li>[B2.name]</li>" //add the item to the manifest if(slip) slip.info += "<li>[B2.name]</li>" //add the item to the manifest
//manifest finalisation //manifest finalisation
slip.info += "</ul><br>" if(slip)
slip.info += "CHECK CONTENTS AND STAMP BELOW THE LINE TO CONFIRM RECEIPT OF GOODS<hr>" slip.info += "</ul><br>"
if (SP.contraband) slip.loc = null //we are out of blanks for Form #44-D Ordering Illicit Drugs. slip.info += "CHECK CONTENTS AND STAMP BELOW THE LINE TO CONFIRM RECEIPT OF GOODS<hr>"
shoppinglist.Cut() shoppinglist.Cut()
return return

View File

@@ -144,7 +144,7 @@
_tname {\ _tname {\
name = _name ;\ name = _name ;\
containername = _cname ;\ containername = _cname ;\
containertype = /obj/structure/closet/crate/secure;\ containertype = /obj/structure/closet/crate;\
cost = _cost ;\ cost = _cost ;\
contains = list( _type , _type );\ contains = list( _type , _type );\
group = "Reagent Cartridges"\ group = "Reagent Cartridges"\