view() is picking up the same atoms multiple times when the viewer is on multiple turfs
This seems to occur with oview() as well
Numbered Steps to Reproduce Problem:
Stand in the middle of multiple turfs(I drew black lines to define the borders of each turf),
Click count overlays verb
Notice that there are triple the atoms being listed than there should be
Demo: https://gofile.io/d/yDdXZK
Code used for count overlays verb
set category = "Debug"
set desc = "Display overlays in view"
set name = "Count Overlays"
var/atoms = 0
var/overlays = 0
var/underlays = 0
var/viscontents = 0
for(var/atom/A in view())
atoms++
overlays += A.overlays.len
underlays += A.underlays.len
var/screenobj = screen.len
var/screenobjoverlays = 0
var/screenobjunderlays = 0
for(var/atom/B in screen)
screenobjoverlays += B.overlays.len
screenobjunderlays += B.underlays.len
var/imagesL = images.len
var/imagesunderlays = 0
var/imagesoverlays = 0
for(var/image/I in images)
imagesoverlays += I.overlays.len
imagesunderlays += I.underlays.len
src << "[atoms] atoms in view, these atoms have [overlays] overlays, [underlays] underlays, and [viscontents] vis_contents."
src << "There are [screenobj] screenobjs, There are [screenobjoverlays] screen overlays, [screenobjunderlays] screen underlays."
src << "There are [imagesL] images, [imagesoverlays] of these are image overlays and [imagesunderlays] are underlays."
Expected Results:
Only atoms in view would be counted
Actual Results:
Atoms in view were counted multiple times
Does the problem occur:
Occurs everytime you stand in multiple turfs
When does the problem NOT occur?
When you are centered on a turf
Workarounds:
Standing in the middle of a turf
However your demo isn't displaying the right information. You're only counting objects, not actually checking what they are. What you need to do is output the \ref for each object in the list, which will tell you their full contents.