From 1b245c04f3d19a03a4ec0f840a06cc04a13ee027 Mon Sep 17 00:00:00 2001 From: Son-of-Space <63861499+Son-of-Space@users.noreply.github.com> Date: Sun, 5 Jun 2022 20:57:30 -0700 Subject: [PATCH] Fixes inspect bounties not generating for most areas and giving invalid areas to scan (#67427) * Fixes inspect scanner giving bounties for areas that cant' be scanned * adds back the range. Adds a check to see if the area is on the map * Re-implements area list as typecacheof --- code/modules/cargo/bounties/security.dm | 28 +++++++++++++++---------- 1 file changed, 17 insertions(+), 11 deletions(-) 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)]"