Fixes objects using walk_to() not being able to be garbage collected.

* Okay evidently walk_to(A, B) doesn't stop when A reaches B, but keeps running in the background forever until it is manually canceled!  Therefore in order to be garbage collected, we must cancel walking on any object that might have initiated it.
* Fixes this on chemsmoke and spiders.
* The same story applies to walk_towards; fixed for dust, meteors and immovablerod, and also to walk_away; fixed for flashbangs.
* Also fixed chemsmoke actually getting qdeled at the right time.
This commit is contained in:
Leshana
2017-06-14 00:27:16 -04:00
parent d8c06c0b34
commit 6a0cc39419
7 changed files with 25 additions and 6 deletions

View File

@@ -41,6 +41,10 @@ In my current plan for it, 'solid' will be defined as anything with density == 1
if(clong && prob(25)) if(clong && prob(25))
src.loc = clong.loc src.loc = clong.loc
Destroy()
walk(src, 0) // Because we might have called walk_towards, we must stop the walk loop or BYOND keeps an internal reference to us forever.
return ..()
/proc/immovablerod() /proc/immovablerod()
var/startx = 0 var/startx = 0
var/starty = 0 var/starty = 0

View File

@@ -90,6 +90,10 @@ The "dust" will damage the hull of the station causin minor hull breaches.
walk_towards(src, goal, 1) walk_towards(src, goal, 1)
return return
Destroy()
walk(src, 0) // Because we might have called walk_towards, we must stop the walk loop or BYOND keeps an internal reference to us forever.
return ..()
touch_map_edge() touch_map_edge()
qdel(src) qdel(src)

View File

@@ -133,7 +133,7 @@
/obj/effect/meteor/Destroy() /obj/effect/meteor/Destroy()
walk(src,0) //this cancels the walk_towards() proc walk(src,0) //this cancels the walk_towards() proc
..() return ..()
/obj/effect/meteor/New() /obj/effect/meteor/New()
..() ..()

View File

@@ -12,6 +12,10 @@
create_reagents(500) create_reagents(500)
return return
/obj/effect/effect/smoke/chem/Destroy()
walk(src, 0) // Because we might have called walk_to, we must stop the walk loop or BYOND keeps an internal reference to us forever.
return ..()
/datum/effect/effect/system/smoke_spread/chem /datum/effect/effect/system/smoke_spread/chem
smoke_type = /obj/effect/effect/smoke/chem smoke_type = /obj/effect/effect/smoke/chem
var/obj/chemholder var/obj/chemholder
@@ -166,7 +170,7 @@
sleep(150+rand(0,20)) // turning it off before it is deleted results in cleaner sleep(150+rand(0,20)) // turning it off before it is deleted results in cleaner
smoke.set_opacity(0) // lighting and view range updates smoke.set_opacity(0) // lighting and view range updates
fadeOut(smoke) fadeOut(smoke)
qdel(src) qdel(smoke)
/datum/effect/effect/system/smoke_spread/chem/spores/spawnSmoke(var/turf/T, var/icon/I, var/dist = 1) /datum/effect/effect/system/smoke_spread/chem/spores/spawnSmoke(var/turf/T, var/icon/I, var/dist = 1)
var/obj/effect/effect/smoke/chem/spores = new /obj/effect/effect/smoke/chem(location) var/obj/effect/effect/smoke/chem/spores = new /obj/effect/effect/smoke/chem(location)

View File

@@ -179,7 +179,9 @@ steam.start() -- spawns the effect
/obj/effect/effect/smoke/New() /obj/effect/effect/smoke/New()
..() ..()
if(time_to_live)
spawn (time_to_live) spawn (time_to_live)
if(!QDELETED(src))
qdel(src) qdel(src)
/obj/effect/effect/smoke/Crossed(mob/living/carbon/M as mob ) /obj/effect/effect/smoke/Crossed(mob/living/carbon/M as mob )

View File

@@ -94,7 +94,7 @@
var/obj/item/organ/external/O = loc var/obj/item/organ/external/O = loc
O.implants -= src O.implants -= src
..() return ..()
/obj/effect/spider/eggcluster/process() /obj/effect/spider/eggcluster/process()
amount_grown += rand(0,2) amount_grown += rand(0,2)
@@ -138,7 +138,8 @@
/obj/effect/spider/spiderling/Destroy() /obj/effect/spider/spiderling/Destroy()
processing_objects -= src processing_objects -= src
..() walk(src, 0) // Because we might have called walk_to, we must stop the walk loop or BYOND keeps an internal reference to us forever.
return ..()
/obj/effect/spider/spiderling/Bump(atom/user) /obj/effect/spider/spiderling/Bump(atom/user)
if(istype(user, /obj/structure/table)) if(istype(user, /obj/structure/table))

View File

@@ -91,6 +91,10 @@
M << "<span class='danger'>Your ears start to ring!</span>" M << "<span class='danger'>Your ears start to ring!</span>"
M.update_icons() M.update_icons()
/obj/item/weapon/grenade/flashbang/Destroy()
walk(src, 0) // Because we might have called walk_away, we must stop the walk loop or BYOND keeps an internal reference to us forever.
return ..()
/obj/item/weapon/grenade/flashbang/clusterbang//Created by Polymorph, fixed by Sieve /obj/item/weapon/grenade/flashbang/clusterbang//Created by Polymorph, fixed by Sieve
desc = "Use of this weapon may constiute a war crime in your area, consult your local Colony Director." desc = "Use of this weapon may constiute a war crime in your area, consult your local Colony Director."
name = "clusterbang" name = "clusterbang"