Fixes emergent exploit of iteration order in crew monitors

This commit is contained in:
ShadowLarkens
2020-08-30 19:05:05 -07:00
parent d10cb4aed1
commit dedb854338
3 changed files with 24 additions and 14 deletions
+8 -2
View File
@@ -52,9 +52,15 @@
var/list/map_levels = uniquelist(using_map.get_map_levels(z, TRUE, om_range = DEFAULT_OVERMAP_RANGE))
data["map_levels"] = map_levels
data["crewmembers"] = list()
var/list/crewmembers = list()
for(var/zlevel in map_levels)
data["crewmembers"] += crew_repository.health_data(zlevel)
crewmembers += crew_repository.health_data(zlevel)
// This is apparently necessary, because the above loop produces an emergent behavior
// of telling you what coordinates someone is at even without sensors on,
// because it strictly sorts by zlevel from bottom to top, and by coordinates from top left to bottom right.
shuffle_inplace(crewmembers)
data["crewmembers"] = crewmembers
return data