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
This commit is contained in:
Son-of-Space
2022-06-05 23:57:30 -04:00
committed by GitHub
parent bc553c6fa7
commit 1b245c04f3
+17 -11
View File
@@ -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)]"