Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
silicons committed Jul 28, 2024
1 parent 3da8665 commit d7906fa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion code/controllers/subsystem/supply.dm
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ SUBSYSTEM_DEF(supply)
SO.status = SUP_ORDER_SHIPPED
var/datum/supply_pack/SP = SO.object
var/atom/movable/container = SP.instantiate_pack_at(T)
// todo: containerless support
if(!container)
stack_trace("how")
continue
if(SO.comment)
container.name += " [SO.comment]"
Expand Down
8 changes: 6 additions & 2 deletions code/modules/supply/supply_pack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -158,17 +158,18 @@
. += worth

/**
* todo: return list of entities?
*
* @return container spawned, or null (which can also mean we don't use a container for some reason)
*/
/datum/supply_pack/proc/instantiate_pack_at(atom/where)
. = instantiate_container(where)
ASSERT(.)
instantiate_contents(.)

/datum/supply_pack/proc/instantiate_container(atom/where)
RETURN_TYPE(/atom/movable)

if(container_type)
if(!container_type)
return

var/atom/movable/container = new container_type(where)
Expand All @@ -186,6 +187,9 @@
// todo: getter / setter for req-accesses, enforced cached & deduped lists
obj_container.req_one_access = container_one_access.Copy()

/**
* todo: return list of entities?
*/
/datum/supply_pack/proc/instantiate_contents(atom/where)
var/list/descriptors_to_spawn = resolve_contents_descriptors()
for(var/descriptor in descriptors_to_spawn)
Expand Down

0 comments on commit d7906fa

Please sign in to comment.