Area datums returned from "locate() in world" statements have contents list with zero elements when they actually have contents.
As a consequence, any for-list on the area will not iterate or yield anything.
Numbered Steps to Reproduce Problem:
1. Locate an area of choice from world
2. Run length() on the area's contents
Code Snippet (if applicable) to Reproduce Problem:
Consider cloning this SS13 codebase: https://github.com/Baystation12/Baystation12
Then at the file /code/module/overmap/ships/computers/helm.dm - alter the get_known_sectors proc:
/obj/machinery/computer/ship/helm/proc/get_known_sectors()
var/area/overmap/map = locate() in world
world.log << "Size of area's contents: [length(map.contents)]"
for(var/obj/effect/overmap/visitable/sector/S in map)
if (S.known)
var/datum/computer_file/data/waypoint/R = new()
R.fields["name"] = S.name
R.fields["x"] = S.x
R.fields["y"] = S.y
known_sectors[S.name] = R
..()
Expected Results:
The area datum to have contents list with non-zero length and contain elements.
Actual Results:
The area datum has contents that is completely empty.
Does the problem occur:
Every time? Or how often? Every time
In other games? Unknown
In other user accounts? N/A
On other computers? Unknown
When does the problem NOT occur?
Unknown.
Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.)
Unknown. It may have worked before 513 or 512 judging from how the code has been written.
Workarounds:
Getting the map datum from an other acquisition method.
But are you sure the area has contents at all? The code above doesn't show any way of disproving that the area is empty, and it's entirely possible to instantiate an abstract area that doesn't actually exist on the map and has no contents at all.
Area contents are calculated two ways. First, by looping through all turfs on the map and their contents. (That's what happens in a for() loop, which is why for performance you should always avoid looping through or even using area contents.) Second, areas can also contain objs and mobs directly, for when they're used as rooms in a MUD, so those direct contents are counted as well.
If an area actually is on the map then there's no way that its contents list should be empty. This tells me the area you're getting is one that isn't on the map, so you must have some abstract areas hanging out.