mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-07-20 04:34:32 +01:00
Fixes emergent exploit of iteration order in crew monitors
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user