Update supply.dm

This commit is contained in:
kevinz000
2019-12-16 11:31:03 -07:00
committed by GitHub
parent 5f59d7a9c5
commit d9cd90c3c5
+21 -3
View File
@@ -26,6 +26,13 @@ GLOBAL_LIST_INIT(blacklisted_cargo_types, typecacheof(list(
/obj/structure/extraction_point,
/obj/machinery/syndicatebomb,
/obj/item/hilbertshotel
))
- typecacheof(list(/mob/living/simple_animal/revenant, /mob/living/simple_animal/slaughter)) //These things have snowflake handling.
)
GLOBAL_LIST_INIT(cargo_shuttle_leave_behind_typecache, typecacheof(list(
/mob/living/simple_animal/revenant,
/mob/living/simple_animal/slaughter
)))
/obj/docking_port/mobile/supply
@@ -50,16 +57,27 @@ GLOBAL_LIST_INIT(blacklisted_cargo_types, typecacheof(list(
/obj/docking_port/mobile/supply/canMove()
if(is_station_level(z))
return check_blacklist(shuttle_areas)
return check_blacklist(shuttle_areas, GLOB.blacklisted_cargo_types)
return ..()
/obj/docking_port/mobile/supply/proc/check_blacklist(areaInstances)
/obj/docking_port/mobile/supply/enterTransit()
var/list/leave_behind = list()
for(var/i in check_blacklist(shuttle_areas, GLOB.cargo_shuttle_leave_behind_typecache))
var/atom/movable/AM = i
leave_behind[AM] = AM.loc
. = ..()
for(var/kicked in leave_behind)
var/atom/movable/victim = kicked
var/atom/oldloc = leave_behind[victim]
victim.forceMove(oldloc)
/obj/docking_port/mobile/supply/proc/check_blacklist(areaInstances, list/typecache)
for(var/place in areaInstances)
var/area/shuttle/shuttle_area = place
for(var/trf in shuttle_area)
var/turf/T = trf
for(var/a in T.GetAllContents())
if(is_type_in_typecache(a, GLOB.blacklisted_cargo_types))
if(is_type_in_typecache(a, typecache))
return FALSE
if(istype(a, /obj/structure/closet))//Prevents eigenlockers from ending up at CC
var/obj/structure/closet/c = a