some destroy cleanup (#16958)

* some destroy cleanup

* fix inits

* deconf

* wrong PR

* rm duplicate

* fix that

* forgot that
This commit is contained in:
Kashargul
2025-01-27 09:11:39 +10:00
committed by GitHub
parent e3cf039c34
commit 394b2a4789
11 changed files with 37 additions and 47 deletions
+16 -14
View File
@@ -7,10 +7,9 @@
time_to_live = 300
pass_flags = PASSTABLE | PASSGRILLE | PASSGLASS //PASSGLASS is fine here, it's just so the visual effect can "flow" around glass
/obj/effect/effect/smoke/chem/New()
..()
/obj/effect/effect/smoke/chem/Initialize()
. = ..()
create_reagents(500)
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.
@@ -47,6 +46,14 @@
chemholder = new/obj()
chemholder.create_reagents(500)
/datum/effect/effect/system/smoke_spread/chem/Destroy()
QDEL_NULL(chemholder)
if(targetTurfs)
targetTurfs.Cut()
if(wallList)
wallList.Cut()
. = ..()
//Sets up the chem smoke effect
// Calculates the max range smoke can travel, then gets all turfs in that view range.
// Culls the selected turfs to a (roughly) circle shape, then calls smokeFlow() to make
@@ -174,11 +181,8 @@
walk_to(smoke, T)
if(initial(smoke.opacity))
smoke.set_opacity(1) //switching opacity on after the smoke has spawned, and then
spawn()
sleep(150+rand(0,20)) // turning it off before it is deleted results in cleaner
smoke.set_opacity(0) // lighting and view range updates
fadeOut(smoke)
qdel(smoke)
var/lifespan = 150 + rand(0, 20)
addtimer(CALLBACK(src, PROC_REF(fadeOut)), lifespan)
/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)
@@ -186,16 +190,14 @@
..(T, I, dist, spores)
/datum/effect/effect/system/smoke_spread/chem/proc/fadeOut(var/atom/A, var/frames = 16) // Fades out the smoke smoothly using it's alpha variable.
A.set_opacity(0) // lighting and view range updates
if(A.alpha == 0) //Handle already transparent case
qdel(A)
return
if(frames == 0)
frames = 1 //We will just assume that by 0 frames, the coder meant "during one frame".
var/step = A.alpha / frames
for(var/i = 0, i < frames, i++)
A.alpha -= step
sleep(world.tick_lag)
return
animate(A, alpha = 0, time = frames)
addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(qdel), A), frames, TIMER_UNIQUE)
/datum/effect/effect/system/smoke_spread/chem/proc/smokeFlow() // Smoke pathfinder. Uses a flood fill method based on zones to quickly check what turfs the smoke (airflow) can actually reach.
+14 -7
View File
@@ -38,6 +38,7 @@ would spawn and follow the beaker, even if it is carried or thrown.
/datum/effect/effect/system/proc/start()
/datum/effect/effect/system/Destroy()
location = null
holder = null
return ..()
@@ -178,12 +179,10 @@ steam.start() -- spawns the effect
pixel_x = -32
pixel_y = -32
/obj/effect/effect/smoke/New()
..()
/obj/effect/effect/smoke/Initialize()
. = ..()
if(time_to_live)
spawn (time_to_live)
if(!QDELETED(src))
qdel(src)
addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(qdel), src), time_to_live, TIMER_DELETE_ME)
/obj/effect/effect/smoke/Crossed(mob/living/carbon/M as mob )
if(M.is_incorporeal())
@@ -213,9 +212,9 @@ steam.start() -- spawns the effect
icon = 'icons/effects/effects.dmi'
icon_state = "sparks"
/obj/effect/effect/smoke/illumination/New(var/newloc, var/lifetime=10, var/range=null, var/power=null, var/color=null)
/obj/effect/effect/smoke/illumination/Initialize(mapload, var/lifetime=10, var/range=null, var/power=null, var/color=null)
time_to_live=lifetime
..()
. = ..()
set_light(range, power, color)
/////////////////////////////////////////////
@@ -431,6 +430,10 @@ steam.start() -- spawns the effect
var/processing = 1
var/on = 1
/datum/effect/effect/system/ion_trail_follow/Destroy()
oldposition = null
. = ..()
/datum/effect/effect/system/ion_trail_follow/set_up(atom/atom)
attach(atom)
oldposition = get_turf(atom)
@@ -487,6 +490,10 @@ steam.start() -- spawns the effect
var/processing = 1
var/on = 1
/datum/effect/effect/system/steam_trail_follow/Destroy()
oldposition = null
. = ..()
/datum/effect/effect/system/steam_trail_follow/set_up(atom/atom)
attach(atom)
oldposition = get_turf(atom)
+1 -1
View File
@@ -114,7 +114,7 @@
var/climbing_delay = 1 //If rock_climbing, lower better.
/obj/item/Initialize(mapload)
..()
. = ..()
for(var/path in actions_types)
add_item_action(path)
@@ -23,7 +23,7 @@
B.adjust_integrity(-damage)
new/obj/effect/effect/sparks(src.loc)
new/obj/effect/effect/smoke/illumination(src.loc, 5, range=30, power=30, color="#FFFFFF")
new/obj/effect/effect/smoke/illumination(loc, 5, 30, 30, "#FFFFFF")
qdel(src)
@@ -22,8 +22,6 @@
/obj/item/chainsaw/Destroy()
STOP_PROCESSING(SSobj, src)
if(reagents)
qdel(reagents)
..()
/obj/item/chainsaw/proc/turnOn(mob/user as mob)