Adds subtype friendly method to populate crates.

This commit is contained in:
PsiOmegaDelta
2016-10-05 16:59:02 +02:00
committed by Yoshax
parent 20c3c43f5f
commit 65b12a10f2
4 changed files with 17 additions and 14 deletions

9
code/_helpers/storage.dm Normal file
View File

@@ -0,0 +1,9 @@
/proc/create_objects_in_loc(var/atom/loc, var/list/item_paths)
if(!istype(loc))
CRASH("Inappropriate loction given.")
if(!istype(item_paths))
CRASH("Inappropriate item path list given.")
for(var/item_path in item_paths)
for(var/i = 1 to max(1, item_paths[item_path]))
new item_path(loc)