Containers now properly checks types instead of string paths.

Security and medical belts could contain now no longer existing objects. These types have been removed.

Conflicts:
	code/game/objects/items/weapons/storage/belt.dm
	code/game/objects/structures/inflatable.dm
	code/modules/clothing/under/ties.dm
This commit is contained in:
PsiOmega
2015-02-14 14:16:40 +01:00
parent c71cd925c4
commit fde03b2e94
14 changed files with 332 additions and 340 deletions

View File

@@ -36,7 +36,7 @@
max_w_class = 2 max_w_class = 2
storage_slots = 21 storage_slots = 21
can_hold = list() // any can_hold = list() // any
cant_hold = list("/obj/item/weapon/disk/nuclear") cant_hold = list(/obj/item/weapon/disk/nuclear)
/obj/item/weapon/storage/bag/trash/update_icon() /obj/item/weapon/storage/bag/trash/update_icon()
if(contents.len == 0) if(contents.len == 0)
@@ -63,7 +63,7 @@
max_w_class = 2 max_w_class = 2
storage_slots = 21 storage_slots = 21
can_hold = list() // any can_hold = list() // any
cant_hold = list("/obj/item/weapon/disk/nuclear") cant_hold = list(/obj/item/weapon/disk/nuclear)
// ----------------------------- // -----------------------------
// Mining Satchel // Mining Satchel
@@ -79,7 +79,7 @@
storage_slots = 50 storage_slots = 50
max_combined_w_class = 200 //Doesn't matter what this is, so long as it's more or equal to storage_slots * ore.w_class max_combined_w_class = 200 //Doesn't matter what this is, so long as it's more or equal to storage_slots * ore.w_class
max_w_class = 3 max_w_class = 3
can_hold = list("/obj/item/weapon/ore") can_hold = list(/obj/item/weapon/ore)
// ----------------------------- // -----------------------------
@@ -94,7 +94,7 @@
max_combined_w_class = 200 //Doesn't matter what this is, so long as it's more or equal to storage_slots * plants.w_class max_combined_w_class = 200 //Doesn't matter what this is, so long as it's more or equal to storage_slots * plants.w_class
max_w_class = 3 max_w_class = 3
w_class = 2 w_class = 2
can_hold = list("/obj/item/weapon/reagent_containers/food/snacks/grown","/obj/item/seeds","/obj/item/weapon/grown") can_hold = list(/obj/item/weapon/reagent_containers/food/snacks/grown,/obj/item/seeds,/obj/item/weapon/grown)
// ----------------------------- // -----------------------------
@@ -252,4 +252,4 @@
max_combined_w_class = 200 //Doesn't matter what this is, so long as it's more or equal to storage_slots * cash.w_class max_combined_w_class = 200 //Doesn't matter what this is, so long as it's more or equal to storage_slots * cash.w_class
max_w_class = 3 max_w_class = 3
w_class = 2 w_class = 2
can_hold = list("/obj/item/weapon/coin","/obj/item/weapon/spacecash") can_hold = list(/obj/item/weapon/coin,/obj/item/weapon/spacecash)

View File

@@ -13,19 +13,19 @@
icon_state = "utilitybelt" icon_state = "utilitybelt"
item_state = "utility" item_state = "utility"
can_hold = list( can_hold = list(
//"/obj/item/weapon/combitool", ///obj/item/weapon/combitool,
"/obj/item/weapon/crowbar", /obj/item/weapon/crowbar,
"/obj/item/weapon/screwdriver", /obj/item/weapon/screwdriver,
"/obj/item/weapon/weldingtool", /obj/item/weapon/weldingtool,
"/obj/item/weapon/wirecutters", /obj/item/weapon/wirecutters,
"/obj/item/weapon/wrench", /obj/item/weapon/wrench,
"/obj/item/device/multitool", /obj/item/device/multitool,
"/obj/item/device/flashlight", /obj/item/device/flashlight,
"/obj/item/stack/cable_coil", /obj/item/stack/cable_coil,
"/obj/item/device/t_scanner", /obj/item/device/t_scanner,
"/obj/item/device/analyzer", /obj/item/device/analyzer,
"/obj/item/taperoll/engineering", /obj/item/taperoll/engineering,
"/obj/item/device/robotanalyzer") /obj/item/device/robotanalyzer)
/obj/item/weapon/storage/belt/utility/full/New() /obj/item/weapon/storage/belt/utility/full/New()
@@ -55,22 +55,21 @@
icon_state = "medicalbelt" icon_state = "medicalbelt"
item_state = "medical" item_state = "medical"
can_hold = list( can_hold = list(
"/obj/item/device/healthanalyzer", /obj/item/device/healthanalyzer,
"/obj/item/weapon/dnainjector", /obj/item/weapon/dnainjector,
"/obj/item/weapon/reagent_containers/dropper", /obj/item/weapon/reagent_containers/dropper,
"/obj/item/weapon/reagent_containers/glass/beaker", /obj/item/weapon/reagent_containers/glass/beaker,
"/obj/item/weapon/reagent_containers/glass/bottle", /obj/item/weapon/reagent_containers/glass/bottle,
"/obj/item/weapon/reagent_containers/pill", /obj/item/weapon/reagent_containers/pill,
"/obj/item/weapon/reagent_containers/syringe", /obj/item/weapon/reagent_containers/syringe,
"/obj/item/weapon/reagent_containers/glass/dispenser", /obj/item/weapon/flame/lighter/zippo,
"/obj/item/weapon/flame/lighter/zippo", /obj/item/weapon/storage/fancy/cigarettes,
"/obj/item/weapon/storage/fancy/cigarettes", /obj/item/weapon/storage/pill_bottle,
"/obj/item/weapon/storage/pill_bottle", /obj/item/stack/medical,
"/obj/item/stack/medical", /obj/item/device/flashlight/pen,
"/obj/item/device/flashlight/pen", /obj/item/clothing/mask/surgical,
"/obj/item/clothing/mask/surgical", /obj/item/clothing/gloves/latex,
"/obj/item/clothing/gloves/latex", /obj/item/weapon/reagent_containers/hypospray
"/obj/item/weapon/reagent_containers/hypospray"
) )
/obj/item/weapon/storage/belt/medical/emt /obj/item/weapon/storage/belt/medical/emt
@@ -90,25 +89,24 @@
max_w_class = 3 max_w_class = 3
max_combined_w_class = 21 max_combined_w_class = 21
can_hold = list( can_hold = list(
"/obj/item/weapon/grenade", /obj/item/weapon/grenade,
"/obj/item/weapon/reagent_containers/spray/pepper", /obj/item/weapon/reagent_containers/spray/pepper,
"/obj/item/weapon/handcuffs", /obj/item/weapon/handcuffs,
"/obj/item/device/flash", /obj/item/device/flash,
"/obj/item/clothing/glasses", /obj/item/clothing/glasses,
"/obj/item/ammo_casing/shotgun", /obj/item/ammo_casing/shotgun,
"/obj/item/ammo_magazine", /obj/item/ammo_magazine,
"/obj/item/weapon/reagent_containers/food/snacks/donut/normal", /obj/item/weapon/reagent_containers/food/snacks/donut/normal,
"/obj/item/weapon/reagent_containers/food/snacks/donut/jelly", /obj/item/weapon/reagent_containers/food/snacks/donut/jelly,
"/obj/item/weapon/melee/baton", /obj/item/weapon/melee/baton,
"/obj/item/weapon/gun/energy/taser", /obj/item/weapon/gun/energy/taser,
"/obj/item/weapon/flame/lighter/zippo", /obj/item/weapon/flame/lighter/zippo,
"/obj/item/weapon/cigpacket", /obj/item/clothing/glasses/hud/security,
"/obj/item/clothing/glasses/hud/security", /obj/item/device/flashlight,
"/obj/item/device/flashlight", /obj/item/device/pda,
"/obj/item/device/pda", /obj/item/device/radio/headset,
"/obj/item/device/radio/headset", /obj/item/weapon/melee,
"/obj/item/weapon/melee", /obj/item/taperoll/police
"/obj/item/taperoll/police"
) )
/obj/item/weapon/storage/belt/soulstone /obj/item/weapon/storage/belt/soulstone
@@ -118,7 +116,7 @@
item_state = "soulstonebelt" item_state = "soulstonebelt"
storage_slots = 6 storage_slots = 6
can_hold = list( can_hold = list(
"/obj/item/device/soulstone" /obj/item/device/soulstone
) )
/obj/item/weapon/storage/belt/soulstone/full/New() /obj/item/weapon/storage/belt/soulstone/full/New()

View File

@@ -344,7 +344,7 @@
icon = 'icons/obj/food.dmi' icon = 'icons/obj/food.dmi'
icon_state = "monkeycubebox" icon_state = "monkeycubebox"
storage_slots = 7 storage_slots = 7
can_hold = list("/obj/item/weapon/reagent_containers/food/snacks/monkeycube") can_hold = list(/obj/item/weapon/reagent_containers/food/snacks/monkeycube)
New() New()
..() ..()
if(src.type == /obj/item/weapon/storage/box/monkeycubes) if(src.type == /obj/item/weapon/storage/box/monkeycubes)
@@ -458,7 +458,7 @@
icon = 'icons/obj/toy.dmi' icon = 'icons/obj/toy.dmi'
icon_state = "spbox" icon_state = "spbox"
storage_slots = 8 storage_slots = 8
can_hold = list("/obj/item/toy/snappop") can_hold = list(/obj/item/toy/snappop)
New() New()
..() ..()
for(var/i=1; i <= storage_slots; i++) for(var/i=1; i <= storage_slots; i++)
@@ -473,7 +473,7 @@
storage_slots = 10 storage_slots = 10
w_class = 1 w_class = 1
slot_flags = SLOT_BELT slot_flags = SLOT_BELT
can_hold = list("/obj/item/weapon/flame/match") can_hold = list(/obj/item/weapon/flame/match)
New() New()
..() ..()
@@ -506,7 +506,7 @@
item_state = "syringe_kit" item_state = "syringe_kit"
foldable = /obj/item/stack/sheet/cardboard //BubbleWrap foldable = /obj/item/stack/sheet/cardboard //BubbleWrap
storage_slots=21 storage_slots=21
can_hold = list("/obj/item/weapon/light/tube", "/obj/item/weapon/light/bulb") can_hold = list(/obj/item/weapon/light/tube, /obj/item/weapon/light/bulb)
max_combined_w_class = 42 //holds 21 items of w_class 2 max_combined_w_class = 42 //holds 21 items of w_class 2
use_to_pickup = 1 // for picking up broken bulbs, not that most people will try use_to_pickup = 1 // for picking up broken bulbs, not that most people will try

View File

@@ -48,7 +48,7 @@
name = "egg box" name = "egg box"
storage_slots = 12 storage_slots = 12
max_combined_w_class = 24 max_combined_w_class = 24
can_hold = list("/obj/item/weapon/reagent_containers/food/snacks/egg") can_hold = list(/obj/item/weapon/reagent_containers/food/snacks/egg)
/obj/item/weapon/storage/fancy/egg_box/New() /obj/item/weapon/storage/fancy/egg_box/New()
..() ..()
@@ -91,7 +91,7 @@
storage_slots = 6 storage_slots = 6
icon_type = "crayon" icon_type = "crayon"
can_hold = list( can_hold = list(
"/obj/item/toy/crayon" /obj/item/toy/crayon
) )
/obj/item/weapon/storage/fancy/crayons/New() /obj/item/weapon/storage/fancy/crayons/New()
@@ -134,7 +134,7 @@
throwforce = 2 throwforce = 2
slot_flags = SLOT_BELT slot_flags = SLOT_BELT
storage_slots = 6 storage_slots = 6
can_hold = list("/obj/item/clothing/mask/cigarette") can_hold = list(/obj/item/clothing/mask/smokable/cigarette)
icon_type = "cigarette" icon_type = "cigarette"
/obj/item/weapon/storage/fancy/cigarettes/New() /obj/item/weapon/storage/fancy/cigarettes/New()
@@ -190,7 +190,7 @@
throwforce = 2 throwforce = 2
slot_flags = SLOT_BELT slot_flags = SLOT_BELT
storage_slots = 7 storage_slots = 7
can_hold = list("/obj/item/clothing/mask/cigarette/cigar") can_hold = list(/obj/item/clothing/mask/smokable/cigarette/cigar)
icon_type = "cigar" icon_type = "cigar"
/obj/item/weapon/storage/fancy/cigar/New() /obj/item/weapon/storage/fancy/cigar/New()
@@ -239,7 +239,7 @@
icon_type = "vial" icon_type = "vial"
name = "vial storage box" name = "vial storage box"
storage_slots = 6 storage_slots = 6
can_hold = list("/obj/item/weapon/reagent_containers/glass/beaker/vial") can_hold = list(/obj/item/weapon/reagent_containers/glass/beaker/vial)
/obj/item/weapon/storage/fancy/vials/New() /obj/item/weapon/storage/fancy/vials/New()
@@ -255,7 +255,7 @@
icon_state = "vialbox0" icon_state = "vialbox0"
item_state = "syringe_kit" item_state = "syringe_kit"
max_w_class = 3 max_w_class = 3
can_hold = list("/obj/item/weapon/reagent_containers/glass/beaker/vial") can_hold = list(/obj/item/weapon/reagent_containers/glass/beaker/vial)
max_combined_w_class = 14 //The sum of the w_classes of all the items in this storage item. max_combined_w_class = 14 //The sum of the w_classes of all the items in this storage item.
storage_slots = 6 storage_slots = 6
req_access = list(access_virology) req_access = list(access_virology)

View File

@@ -138,7 +138,7 @@
icon = 'icons/obj/chemical.dmi' icon = 'icons/obj/chemical.dmi'
item_state = "contsolid" item_state = "contsolid"
w_class = 2.0 w_class = 2.0
can_hold = list("/obj/item/weapon/reagent_containers/pill","/obj/item/weapon/dice","/obj/item/weapon/paper") can_hold = list(/obj/item/weapon/reagent_containers/pill,/obj/item/weapon/dice,/obj/item/weapon/paper)
allow_quick_gather = 1 allow_quick_gather = 1
use_to_pickup = 1 use_to_pickup = 1
storage_slots = 14 storage_slots = 14

View File

@@ -17,7 +17,7 @@
name = "donut box" name = "donut box"
storage_slots = 6 storage_slots = 6
var/startswith = 6 var/startswith = 6
can_hold = list("/obj/item/weapon/reagent_containers/food/snacks/donut") can_hold = list(/obj/item/weapon/reagent_containers/food/snacks/donut)
foldable = /obj/item/stack/sheet/cardboard foldable = /obj/item/stack/sheet/cardboard
/obj/item/weapon/storage/donut_box/New() /obj/item/weapon/storage/donut_box/New()

View File

@@ -220,7 +220,7 @@
max_w_class = 8 max_w_class = 8
anchored = 1.0 anchored = 1.0
density = 0 density = 0
cant_hold = list("/obj/item/weapon/storage/secure/briefcase") cant_hold = list(/obj/item/weapon/storage/secure/briefcase)
New() New()
..() ..()

View File

@@ -209,21 +209,14 @@
usr << "<span class='notice'>[src] is full, make some space.</span>" usr << "<span class='notice'>[src] is full, make some space.</span>"
return 0 //Storage item is full return 0 //Storage item is full
if(can_hold.len) if(can_hold.len && !is_type_in_list(W, can_hold))
var/ok = 0
for(var/A in can_hold)
if(istype(W, text2path(A) ))
ok = 1
break
if(!ok)
if(!stop_messages) if(!stop_messages)
if (istype(W, /obj/item/weapon/hand_labeler)) if (istype(W, /obj/item/weapon/hand_labeler))
return 0 return 0
usr << "<span class='notice'>[src] cannot hold [W].</span>" usr << "<span class='notice'>[src] cannot hold [W].</span>"
return 0 return 0
for(var/A in cant_hold) //Check for specific items which this container can't hold. if(cant_hold.len && is_type_in_list(W, cant_hold))
if(istype(W, text2path(A) ))
if(!stop_messages) if(!stop_messages)
usr << "<span class='notice'>[src] cannot hold [W].</span>" usr << "<span class='notice'>[src] cannot hold [W].</span>"
return 0 return 0

View File

@@ -5,25 +5,25 @@
icon_state = "wallet" icon_state = "wallet"
w_class = 2 w_class = 2
can_hold = list( can_hold = list(
"/obj/item/weapon/spacecash", /obj/item/weapon/spacecash,
"/obj/item/weapon/card", /obj/item/weapon/card,
"/obj/item/clothing/mask/cigarette", /obj/item/clothing/mask/smokable/cigarette/,
"/obj/item/device/flashlight/pen", /obj/item/device/flashlight/pen,
"/obj/item/seeds", /obj/item/seeds,
"/obj/item/stack/medical", /obj/item/stack/medical,
"/obj/item/toy/crayon", /obj/item/toy/crayon,
"/obj/item/weapon/coin", /obj/item/weapon/coin,
"/obj/item/weapon/dice", /obj/item/weapon/dice,
"/obj/item/weapon/disk", /obj/item/weapon/disk,
"/obj/item/weapon/implanter", /obj/item/weapon/implanter,
"/obj/item/weapon/flame/lighter", /obj/item/weapon/flame/lighter,
"/obj/item/weapon/flame/match", /obj/item/weapon/flame/match,
"/obj/item/weapon/paper", /obj/item/weapon/paper,
"/obj/item/weapon/pen", /obj/item/weapon/pen,
"/obj/item/weapon/photo", /obj/item/weapon/photo,
"/obj/item/weapon/reagent_containers/dropper", /obj/item/weapon/reagent_containers/dropper,
"/obj/item/weapon/screwdriver", /obj/item/weapon/screwdriver,
"/obj/item/weapon/stamp") /obj/item/weapon/stamp)
slot_flags = SLOT_ID slot_flags = SLOT_ID
var/obj/item/weapon/card/id/front_id = null var/obj/item/weapon/card/id/front_id = null

View File

@@ -253,6 +253,7 @@
icon_state = "inf_box" icon_state = "inf_box"
item_state = "syringe_kit" item_state = "syringe_kit"
max_combined_w_class = 21 max_combined_w_class = 21
can_hold = list(/obj/item/inflatable)
New() New()
..() ..()

View File

@@ -86,7 +86,7 @@ var/global/photo_count = 0
icon = 'icons/obj/items.dmi' icon = 'icons/obj/items.dmi'
icon_state = "album" icon_state = "album"
item_state = "briefcase" item_state = "briefcase"
can_hold = list("/obj/item/weapon/photo",) can_hold = list(/obj/item/weapon/photo)
/obj/item/weapon/storage/photo_album/MouseDrop(obj/over_object as obj) /obj/item/weapon/storage/photo_album/MouseDrop(obj/over_object as obj)

View File

@@ -5,24 +5,24 @@
icon_state = "gearbelt" icon_state = "gearbelt"
item_state = "utility" item_state = "utility"
can_hold = list( can_hold = list(
"/obj/item/weapon/storage/box/samplebags", /obj/item/weapon/storage/box/samplebags,
"/obj/item/device/core_sampler", /obj/item/device/core_sampler,
"/obj/item/device/beacon_locator", /obj/item/device/beacon_locator,
"/obj/item/device/radio/beacon", /obj/item/device/radio/beacon,
"/obj/item/device/gps", /obj/item/device/gps,
"/obj/item/device/measuring_tape", /obj/item/device/measuring_tape,
"/obj/item/device/flashlight", /obj/item/device/flashlight,
"/obj/item/weapon/pickaxe", /obj/item/weapon/pickaxe,
"/obj/item/device/depth_scanner", /obj/item/device/depth_scanner,
"/obj/item/device/camera", /obj/item/device/camera,
"/obj/item/weapon/paper", /obj/item/weapon/paper,
"/obj/item/weapon/photo", /obj/item/weapon/photo,
"/obj/item/weapon/folder", /obj/item/weapon/folder,
"/obj/item/weapon/pen", /obj/item/weapon/pen,
"/obj/item/weapon/folder", /obj/item/weapon/folder,
"/obj/item/weapon/clipboard", /obj/item/weapon/clipboard,
"/obj/item/weapon/anodevice", /obj/item/weapon/anodevice,
"/obj/item/clothing/glasses", /obj/item/clothing/glasses,
"/obj/item/weapon/wrench", /obj/item/weapon/wrench,
"/obj/item/weapon/storage/box/excavation", /obj/item/weapon/storage/box/excavation,
"/obj/item/weapon/anobattery") /obj/item/weapon/anobattery)

View File

@@ -33,4 +33,4 @@
storage_slots = 50 storage_slots = 50
max_combined_w_class = 200 //Doesn't matter what this is, so long as it's more or equal to storage_slots * ore.w_class max_combined_w_class = 200 //Doesn't matter what this is, so long as it's more or equal to storage_slots * ore.w_class
max_w_class = 3 max_w_class = 3
can_hold = list("/obj/item/weapon/fossil") can_hold = list(/obj/item/weapon/fossil)

View File

@@ -110,13 +110,13 @@
foldable = /obj/item/stack/sheet/cardboard //BubbleWrap foldable = /obj/item/stack/sheet/cardboard //BubbleWrap
storage_slots = 7 storage_slots = 7
w_class = 2 w_class = 2
can_hold = list("/obj/item/weapon/pickaxe/brush",\ can_hold = list(/obj/item/weapon/pickaxe/brush,\
"/obj/item/weapon/pickaxe/one_pick",\ /obj/item/weapon/pickaxe/one_pick,\
"/obj/item/weapon/pickaxe/two_pick",\ /obj/item/weapon/pickaxe/two_pick,\
"/obj/item/weapon/pickaxe/three_pick",\ /obj/item/weapon/pickaxe/three_pick,\
"/obj/item/weapon/pickaxe/four_pick",\ /obj/item/weapon/pickaxe/four_pick,\
"/obj/item/weapon/pickaxe/five_pick",\ /obj/item/weapon/pickaxe/five_pick,\
"/obj/item/weapon/pickaxe/six_pick") /obj/item/weapon/pickaxe/six_pick)
max_combined_w_class = 17 max_combined_w_class = 17
max_w_class = 4 max_w_class = 4
use_to_pickup = 1 // for picking up broken bulbs, not that most people will try use_to_pickup = 1 // for picking up broken bulbs, not that most people will try