mirror of
https://github.com/fulpstation/fulpstation.git
synced 2025-12-10 18:11:47 +00:00
Works pretty well. If it can't GC something, it'll just del() it and be done. Speed is amazing, holy shit. New procs you should be aware of: qdel(atom/movable) - sets up an object for garbage collection. Call this rather than del(atom/movable). atom/movable/Destroy() - called right before the object is GC'd, so it still has a loc. Also called if the object is del()'d. new controller - garbage.dm has all the details on this. Basically it nulls all references on GC'd objects and force del() them if necessary. Generally speaking, objects should use Destroy() for behavior prior to deletion rather than Del(). You should also always call the parent so the object gets the right gc_destroyed var set. ISSUES: Tries to GC mobs atm. This actually works for new players, not so much for humans/monkies/simple_animals/anything. I'm guessing it needs to clear out their mind and HUD and maybe other things. Gibbing is really bugged. It works, but the overlays just sit there for awhile and ugh. I'm very tempted just to del() mob/living and mob/camera and call it a day. qdel() equipment doesn't unequip the item. Pipes don't generally GC correctly. Debugging suggests they get referenced in many pipenets and that isn't cleared properly. However some do work fine. Need assistance here. Bots don't GC, probably in the radio controller. Lots of other shit doesn't GC but it's hard to find them because of the pipe spam. I think I'm calling Destroy() twice by accident.
70 lines
1.6 KiB
Plaintext
70 lines
1.6 KiB
Plaintext
/obj/effect/expl_particles
|
|
name = "fire"
|
|
icon = 'icons/effects/effects.dmi'
|
|
icon_state = "explosion_particle"
|
|
opacity = 1
|
|
anchored = 1
|
|
mouse_opacity = 0
|
|
|
|
/obj/effect/expl_particles/New()
|
|
..()
|
|
spawn (15)
|
|
qdel(src)
|
|
return
|
|
|
|
/obj/effect/expl_particles/Move()
|
|
..()
|
|
return
|
|
|
|
/datum/effect/system/expl_particles
|
|
var/number = 10
|
|
var/turf/location
|
|
var/total_particles = 0
|
|
|
|
/datum/effect/system/expl_particles/proc/set_up(n = 10, loca)
|
|
number = n
|
|
if(istype(loca, /turf/)) location = loca
|
|
else location = get_turf(loca)
|
|
|
|
/datum/effect/system/expl_particles/proc/start()
|
|
var/i = 0
|
|
for(i=0, i<src.number, i++)
|
|
spawn(0)
|
|
var/obj/effect/expl_particles/expl = new /obj/effect/expl_particles(src.location)
|
|
var/direct = pick(alldirs)
|
|
for(i=0, i<pick(1;25,2;50,3,4;200), i++)
|
|
sleep(1)
|
|
step(expl,direct)
|
|
|
|
/obj/effect/explosion
|
|
name = "fire"
|
|
icon = 'icons/effects/96x96.dmi'
|
|
icon_state = "explosion"
|
|
opacity = 1
|
|
anchored = 1
|
|
mouse_opacity = 0
|
|
pixel_x = -32
|
|
pixel_y = -32
|
|
|
|
/obj/effect/explosion/New()
|
|
..()
|
|
spawn (10)
|
|
qdel(src)
|
|
return
|
|
|
|
/datum/effect/system/explosion
|
|
var/turf/location
|
|
|
|
/datum/effect/system/explosion/proc/set_up(loca)
|
|
if(istype(loca, /turf/)) location = loca
|
|
else location = get_turf(loca)
|
|
|
|
/datum/effect/system/explosion/proc/start()
|
|
new/obj/effect/explosion( location )
|
|
var/datum/effect/system/expl_particles/P = new/datum/effect/system/expl_particles()
|
|
P.set_up(10,location)
|
|
P.start()
|
|
spawn(5)
|
|
var/datum/effect/effect/system/harmless_smoke_spread/S = new/datum/effect/effect/system/harmless_smoke_spread()
|
|
S.set_up(5,0,location,null)
|
|
S.start() |