When creating new turfs during runtime, the behavior DM provides in the map editor is lost. So, after creating my own underlays preservation within the building procedures. (Save underlays in a list, perform actions for new turf, apply underlays)
However, there is a small dispute here. If you define child turfs, and try to use this, it seems to fail. For example, creation /turf/Grass/Grass1, and then trying to build /turf/Grass/Grass1/Grass_ELeft over it, the underlays fail to preserve. Yet, when I build something such as a sand edge, it works perfectly fine. The same goes for all types; A grass edge on sand is fine, but a sand edge on sand fails as well. It seems things of the same type cannot preserve underlays?
Numbered Steps to Reproduce Problem:
Try to create a turf at runtime which is a child of the turf being replaced, with the latter turf being 'preserved' as an underlay.
Code Snippet (if applicable) to Reproduce Problem:
mob
Move()
var/turf/oldloc = loc
. = ..()
if(on)
if(oldloc != loc)
build()
var
targ
nid = "Build!"
id = 0
on = 0
proc
build(par)
var/test = par
var/list/olays = list()
var/turf/t = loc
olays.Add(
t.overlays,
image(icon = t.icon, icon_state = t.icon_state, dir = t.dir, layer = t.layer),
t.underlays)
if(test)
nid = par
if(id != nid )
on = 1
id = nid
else if(id == nid)
on = 0
id = 0
return
var/turf/nt = new targ(loc)
nt.AddUnderlay(olays)
if(buildinside)
new /area/Inside(loc)
return
build_tile(t2p, b)
targ = t2p
build(b)
obj
Build
Click()
..()
usr.build_tile(t2p, name)
var
t2p
Expected Results:
Allow all child turfs to be able to replace their parents and preserve their images as underlays
Actual Results:
Turf fails to preserve it's predecessor as an underlay
Does the problem occur:
Every time? Or how often? Every time
In other games? Never tried it in other games
In other user accounts? Haven't tested that
On other computers? Nor have I tested this
When does the problem NOT occur?
It always occurs to my knowledge.
Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? I haven't checked these either, but I would imagine it's the same for each build.
Workarounds: