From 269cbab223c4f0c06a3046f4c6960b75f71c9ffa Mon Sep 17 00:00:00 2001 From: AnturK Date: Fri, 12 Jan 2018 18:08:21 +0100 Subject: [PATCH] Fixes cables/lattices for lateloaded templates. --- code/game/turfs/ChangeTurf.dm | 2 ++ code/game/turfs/turf.dm | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/code/game/turfs/ChangeTurf.dm b/code/game/turfs/ChangeTurf.dm index ce5086fe4c..a55f546c1a 100644 --- a/code/game/turfs/ChangeTurf.dm +++ b/code/game/turfs/ChangeTurf.dm @@ -193,6 +193,8 @@ newT.baseturfs = new_baseturfs return newT + +//If you modify this function, ensure it works correctly with lateloaded map templates. /turf/proc/AfterChange(flags) //called after a turf has been replaced in ChangeTurf() levelupdate() CalculateAdjacentTurfs() diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index 97ebcd3a26..472df91354 100755 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -239,19 +239,19 @@ /turf/proc/levelupdate() for(var/obj/O in src) - if(O.level == 1) + if(O.level == 1 && O.initialized) O.hide(src.intact) // override for space turfs, since they should never hide anything /turf/open/space/levelupdate() for(var/obj/O in src) - if(O.level == 1) + if(O.level == 1 && O.initialized) O.hide(0) // Removes all signs of lattice on the pos of the turf -Donkieyo /turf/proc/RemoveLattice() var/obj/structure/lattice/L = locate(/obj/structure/lattice, src) - if(L) + if(L && L.initialized) qdel(L) /turf/proc/phase_damage_creatures(damage,mob/U = null)//>Ninja Code. Hurts and knocks out creatures on this turf //NINJACODE