ID:2777527
 
BYOND Version:514
Operating System:Windows 10 Home 64-bit
Web Browser:Firefox 99.0
Applies to:Dream Daemon
Status: Open

Issue hasn't been assigned a status value.
Descriptive Problem Summary:
Objects bigger than a turf and on map border during map expansion won't have their locs' contents set properly.
I'd imagine this also apply to smaller ones that use pixel movement, but untested

Numbered Steps to Reproduce Problem:

Code Snippet (if applicable) to Reproduce Problem, something like this, i dunno:
/atom/movable/fun
bound_width = 64

/proc/test()
var/turf/T = locate(world.maxx, world.maxy, 1)
var/atom/movable/fun/F = new(T)
world.maxx += 1
world << "Number of contents at [T.x],[T.y],[T.z]: [length(T.contents)]"
var/turf/N = locate(world.maxx, T.y, T.z)
world << "Number of contents at [N.x],[N.y],[N.z]: [length(N.contents)]"


Expected Results, sorta, give or take:
Number of contents at 10,10,1: 1
Number of contents at 11,10,1: 1

Actual Results, sadly:
Number of contents at 10,10,1: 1
Number of contents at 11,10,1: 0 !!!!!!!! <- here

Does the problem occur:
Every time? Or how often? Yes
In other games? Replicated on another SS13 codebase, but that shares similar backend
In other user accounts? Uh....
On other computers? Yes

When does the problem NOT occur?
When not using atoms more than one turf in height/width, or not performing world map expansion while they're not to border.

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.)
Can't say for sure but i believe we've had this problem for 6-12 months.

Workarounds:
loc = loc

(this is not a joke)

Why this happens:
Long story short, usually, putting an /atom somewhere sets its 'loc', and 'contents' of its 'loc' in accordance. For atoms using eg. bound_width or bound_height that border on several turfs, we similarly use the multiple 'locs'.

When you place an atom near map border, it clips outside of the map, but there's nothing to set 'contents' on. However, once you expand the map, new turfs are added, but the contents are not inferred retroactively.

This is noticeable on SS13 because of /tg/ maploader which for some reason expands through X direction while reading map contents. This means multitiles it spawn will past a certain point in dimensions suffer from this, as it keeps expanding in X direction right after instanciating them.

FWIW, In our case @ CM-SS13 we noticed that due to atmospheric map props (... rocks) on one of our maps which would all be lacking collision for over a year (as mob/turf code uses the contents).
Right, so, replicated this on 514.1582, 513.1542, 513.1536, and i believe it was also the case back on 513.1512 (little details too easily dismissed..)

Either way i'd believe this is an oversight and irrelevant
Do you have a test project for this I can try out? It'll be easier than trying to work from a snippet and I'll be sure we're on the same page.
Not right now, I'll try and piece something together soonTM
/atom/movable/fun
bound_width = 64

/world/New()
. = ..()
world.maxx = 10
world.maxy = 10
world.maxz = 1
var/turf/T = locate(world.maxx, world.maxy, 1)
var/atom/movable/fun/F = new(T)
world.maxx += 1
var/turf/N = locate(world.maxx, T.y, T.z)
world.log << "Number of contents at [T.x],[T.y],[T.z]: [length(T.contents)]"
world.log << "Number of contents at [N.x],[N.y],[N.z]: [length(N.contents)]"
world.log << "loc = loc"
F.loc = F.loc
world.log << "Number of contents at [T.x],[T.y],[T.z]: [length(T.contents)]"
world.log << "Number of contents at [N.x],[N.y],[N.z]: [length(N.contents)]"


Save as .dme, build/run


Sun Mar 27 13:42:15 2022
World opened on network port 54885.
Welcome BYOND! (5.0 Public Version 514.1580)
Number of contents at 10,10,1: 1
Number of contents at 11,10,1: 0
loc = loc
Number of contents at 10,10,1: 1
Number of contents at 11,10,1: 1



Sun Mar 27 11:54:42 2022
Auto-safety mode: ultrasafe (no file access)
World opened on network port 36055.
Welcome BYOND! (5.0 Public Version 513.1532)
Number of contents at 10,10,1: 1
Number of contents at 11,10,1: 0
loc = loc
Number of contents at 10,10,1: 1
Number of contents at 11,10,1: 1
Bumping this after a quick msg on the patreon discord about it.