diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 564910d3df..6d61f7aa13 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -949,6 +949,8 @@ proc/DuplicateObject(obj/original, var/perfectcopy = 0 , var/sameloc = 0) // Movement based on lower left corner. Tiles that do not fit // into the new area will not be moved. + // Does *not* affect gases etc; copied turfs will be changed via ChangeTurf, and the dir, icon, and icon_state copied. All other vars will remain default. + if(!A || !src) return 0 var/list/turfs_src = get_area_turfs(src.type) @@ -1002,7 +1004,8 @@ proc/DuplicateObject(obj/original, var/perfectcopy = 0 , var/sameloc = 0) if(istype(B, /turf/space)) continue moving - var/turf/X = new T.type(B) + var/turf/X = B + X.ChangeTurf(T.type) X.set_dir(old_dir1) X.icon_state = old_icon_state1 X.icon = old_icon1 //Shuttle floors are in shuttle.dmi while the defaults are floors.dmi @@ -1042,12 +1045,6 @@ proc/DuplicateObject(obj/original, var/perfectcopy = 0 , var/sameloc = 0) copiedobjs += newobjs copiedobjs += newmobs - - - for(var/V in T.vars) - if(!(V in list("type","loc","locs","vars", "parent", "parent_type","verbs","ckey","key","x","y","z","contents", "luminosity"))) - X.vars[V] = T.vars[V] - // var/area/AR = X.loc // if(AR.lighting_use_dynamic) @@ -1063,22 +1060,9 @@ proc/DuplicateObject(obj/original, var/perfectcopy = 0 , var/sameloc = 0) - var/list/doors = new/list() - if(toupdate.len) for(var/turf/simulated/T1 in toupdate) - for(var/obj/machinery/door/D2 in T1) - doors += D2 - /*if(T1.parent) - air_master.groups_to_rebuild += T1.parent - else - air_master.tiles_to_update += T1*/ - - for(var/obj/O in doors) - O:update_nearby_tiles(1) - - - + air_master.mark_for_update(T1) return copiedobjs