mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-25 22:19:30 +01:00
Reorder spacevine change turf
qdel spacevines lead to them calling changeturf, lead to them being qdeleted lead to them calling changeturf etc etc This way the turf is changed before the vines are deleted, so the changeturf calls should not be hit. Further protection is added in the form of checking if that vine is actually in the process of being qdeleted, which limits the recursion to the maximum of how many vines are on the tile
This commit is contained in:
@@ -211,7 +211,9 @@
|
||||
ChangeTurf(src.baseturf)
|
||||
|
||||
/turf/open/floor/vines/ChangeTurf(turf/open/floor/T)
|
||||
for(var/obj/structure/spacevine/SV in src)
|
||||
qdel(SV)
|
||||
. = ..()
|
||||
//Do this *after* the turf has changed as qdel in spacevines will call changeturf again if it hasn't
|
||||
for(var/obj/structure/spacevine/SV in src)
|
||||
if(!qdestroying(SV))//Helps avoid recursive loops
|
||||
qdel(SV)
|
||||
UpdateAffectingLights()
|
||||
|
||||
Reference in New Issue
Block a user