Resolves issue 977 - randomised supply packs are randomised at the time of purchase

Clicking cancel when prompted for a reason for an order will cancel the order rather than using a default reason.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4779 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
elly1989@rocketmail.com
2012-09-30 14:40:48 +00:00
parent e064bd15bd
commit b932099768
2 changed files with 17 additions and 13 deletions
+3 -10
View File
@@ -8,7 +8,7 @@
/datum/supply_packs
var/name = null
var/list/contains = list()
var/manifest
var/manifest = ""
var/amount = null
var/cost = null
var/containertype = null
@@ -18,7 +18,7 @@
var/contraband = 0
/datum/supply_packs/New()
manifest = "<ul>"
manifest += "<ul>"
for(var/path in contains)
if(!path) continue
var/atom/movable/AM = new path()
@@ -574,12 +574,8 @@
/obj/item/clothing/head/collectable/thunderdome,
/obj/item/clothing/head/collectable/swat,
/obj/item/clothing/head/collectable/metroid,
/obj/item/clothing/head/collectable/metroid,
/obj/item/clothing/head/collectable/police,
/obj/item/clothing/head/collectable/police,
/obj/item/clothing/head/collectable/slime,
/obj/item/clothing/head/collectable/slime,
/obj/item/clothing/head/collectable/xenom,
/obj/item/clothing/head/collectable/xenom,
/obj/item/clothing/head/collectable/petehat)
name = "Collectable hat crate!"
@@ -588,10 +584,7 @@
containername = "Collectable hats crate! Brought to you by Bass.inc!"
/datum/supply_packs/randomised/New()
var/list/tempContains = list()
for(var/i = 0,i<num_contained,i++)
tempContains += pick(contains)
contains = tempContains
manifest += "Contains any [num_contained] of:"
..()
+14 -3
View File
@@ -302,7 +302,18 @@ var/list/mechtoys = list(
if(SP.access)
A:req_access = list()
A:req_access += text2num(SP.access)
for(var/typepath in SP.contains)
var/list/contains
if(istype(SP,/datum/supply_packs/randomised))
var/datum/supply_packs/randomised/SPR = SP
contains = list()
if(SPR.contains.len)
for(var/j=1,j<=SPR.num_contained,j++)
contains += pick(SPR.contains)
else
contains = SP.contains
for(var/typepath in contains)
if(!typepath) continue
var/atom/B2 = new typepath(A)
if(SP.amount && B2:amount) B2:amount = SP.amount
@@ -390,7 +401,7 @@ var/list/mechtoys = list(
var/timeout = world.time + 600
var/reason = copytext(sanitize(input(usr,"Reason:","Why do you require this item?","") as null|text),1,MAX_MESSAGE_LEN)
if(world.time > timeout) return
if(!reason) reason = "*None Provided*"
if(!reason) return
var/idname = "*None Provided*"
var/idrank = "*None Provided*"
@@ -563,7 +574,7 @@ var/list/mechtoys = list(
var/timeout = world.time + 600
var/reason = copytext(sanitize(input(usr,"Reason:","Why do you require this item?","") as null|text),1,MAX_MESSAGE_LEN)
if(world.time > timeout) return
if(!reason) reason = "*None Provided*"
if(!reason) return
var/idname = "*None Provided*"
var/idrank = "*None Provided*"