diff --git a/code/modules/cargo/bounties/security.dm b/code/modules/cargo/bounties/security.dm index dee709ca918..ab395ebcc73 100644 --- a/code/modules/cargo/bounties/security.dm +++ b/code/modules/cargo/bounties/security.dm @@ -50,17 +50,23 @@ var/area/demanded_area /datum/bounty/item/security/paperwork/New() - ///list of areas for security to choose from to perform an inspection. - var/static/list/possible_areas = list(\ - /area/station/maintenance,\ - /area/station/commons,\ - /area/station/service,\ - /area/station/hallway/primary,\ - /area/station/security/office,\ - /area/station/security/prison,\ - /area/station/security/range,\ - /area/station/security/checkpoint,\ - /area/station/security/interrogation) + ///list of areas for security to choose from to perform an inspection. Pulls the list and cross references it to the map to make sure the area is on the map before assigning. + var/static/list/possible_areas + if(!possible_areas) + possible_areas = typecacheof(list(\ + /area/station/maintenance,\ + /area/station/commons,\ + /area/station/service,\ + /area/station/hallway/primary,\ + /area/station/security/office,\ + /area/station/security/prison,\ + /area/station/security/range,\ + /area/station/security/checkpoint,\ + /area/station/security/interrogation)) + for (var/area_type in possible_areas) + if(GLOB.areas_by_type[area_type]) + continue + possible_areas -= area_type demanded_area = pick(possible_areas) name = name + ": [initial(demanded_area.name)]" description = initial(description) + " [initial(demanded_area.name)]"