mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 03:57:13 +01:00
-tg- atom pooling system, qdel changes
This commit first and foremost ports the -tg- atom pooling system, and removes the old experimental system entirely. Secondly, this PR modifies the qdel system to use a -tg- lookalike "destroy hint" system, which means that individual objects can tell qdel what to do with them beyond taking care of things they need to delete. This ties into the atom pooling system via a new hint define, QDEL_HINT_PUTINPOOL, which will place the atom in the pool instead of deleting it as per standard. Emitter beams are now fully pooled. Qdel now has semi-compatibility with all datum types, however it is not the same as -tg-'s "Queue everything!" system. It simply passes it through the GC immediately and adds it to the "hard del" lists. This means that reagents can be qdel'ed, but there is no purpose as of yet, as it is more or less the same as just deleting them, with the added effect of adding logs of them being deleted to the garbage collector.
This commit is contained in:
@@ -38,7 +38,7 @@
|
||||
/obj/machinery/power/am_control_unit/Destroy()//Perhaps damage and run stability checks rather than just del on the others
|
||||
for(var/obj/machinery/am_shielding/AMS in linked_shielding)
|
||||
del(AMS)
|
||||
..()
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/machinery/power/am_control_unit/process()
|
||||
|
||||
@@ -70,8 +70,7 @@ proc/cardinalrange(var/center)
|
||||
if(processing) shutdown_core()
|
||||
visible_message("\red The [src.name] melts!")
|
||||
//Might want to have it leave a mess on the floor but no sprites for now
|
||||
..()
|
||||
return
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/machinery/am_shielding/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
|
||||
@@ -1335,7 +1335,7 @@ obj/machinery/power/apc/proc/autoset(var/val, var/on)
|
||||
area.power_change()
|
||||
if(occupant)
|
||||
malfvacate(1)
|
||||
..()
|
||||
return ..()
|
||||
|
||||
/obj/machinery/power/apc/proc/shock(mob/user, prb)
|
||||
if(!prob(prb))
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
attached.anchored = 0
|
||||
attached.attached = null
|
||||
attached = null*/
|
||||
..() // then go ahead and delete the cable
|
||||
return ..() // then go ahead and delete the cable
|
||||
|
||||
/obj/structure/cable/hide(var/i)
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ var/const/GRAV_NEEDS_WRENCH = 3
|
||||
set_broken()
|
||||
if(main_part)
|
||||
qdel(main_part)
|
||||
..()
|
||||
return ..()
|
||||
|
||||
//
|
||||
// Part generator which is mostly there for looks
|
||||
@@ -126,7 +126,7 @@ var/const/GRAV_NEEDS_WRENCH = 3
|
||||
if (!(A.z in config.station_levels)) continue
|
||||
A.gravitychange(0,A)
|
||||
shake_everyone()
|
||||
..()
|
||||
return ..()
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -211,7 +211,7 @@
|
||||
if(A)
|
||||
on = 0
|
||||
// A.update_lights()
|
||||
..()
|
||||
return ..()
|
||||
|
||||
/obj/machinery/light/update_icon()
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ display round(lastgen) and plasmatank amount
|
||||
|
||||
/obj/machinery/power/port_gen/pacman/Destroy()
|
||||
DropFuel()
|
||||
..()
|
||||
return ..()
|
||||
|
||||
/obj/machinery/power/port_gen/pacman/RefreshParts()
|
||||
var/temp_rating = 0
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
/obj/machinery/power/Destroy()
|
||||
disconnect_from_network()
|
||||
..()
|
||||
return ..()
|
||||
|
||||
// common helper procs for all power machines
|
||||
/obj/machinery/power/proc/add_avail(var/amount)
|
||||
|
||||
@@ -23,7 +23,7 @@ var/global/list/rad_collectors = list()
|
||||
|
||||
/obj/machinery/power/rad_collector/Destroy()
|
||||
rad_collectors -= src
|
||||
..()
|
||||
return ..()
|
||||
|
||||
/obj/machinery/power/rad_collector/process()
|
||||
if(P)
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
FG1.cleanup()
|
||||
if(FG2 && !FG2.clean_up)
|
||||
FG2.cleanup()
|
||||
..()
|
||||
return ..()
|
||||
|
||||
/obj/machinery/containment_field/attack_hand(mob/user as mob)
|
||||
if(get_dist(src, user) > 1)
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
msg_admin_attack("Emitter deleted at ([x],[y],[z] - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>JMP</a>)",0,1)
|
||||
log_game("Emitter deleted at ([x],[y],[z])")
|
||||
investigate_log("<font color='red'>deleted</font> at ([x],[y],[z])","singulo")
|
||||
..()
|
||||
return ..()
|
||||
|
||||
/obj/machinery/power/emitter/update_icon()
|
||||
if (active && powernet && avail(active_power_usage))
|
||||
@@ -167,13 +167,16 @@
|
||||
else
|
||||
src.fire_delay = rand(20,100)
|
||||
src.shot_number = 0
|
||||
var/obj/item/projectile/beam/emitter/A = new /obj/item/projectile/beam/emitter(src.loc)
|
||||
|
||||
var/obj/item/projectile/beam/emitter/A = PoolOrNew(/obj/item/projectile/beam/emitter,src.loc)
|
||||
|
||||
A.dir = src.dir
|
||||
playsound(get_turf(src), 'sound/weapons/emitter.ogg', 25, 1)
|
||||
if(prob(35))
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(5, 1, src)
|
||||
s.start()
|
||||
A.dir = src.dir
|
||||
|
||||
switch(dir)
|
||||
if(NORTH)
|
||||
A.yo = 20
|
||||
|
||||
@@ -175,7 +175,7 @@ field_generator power level display
|
||||
|
||||
/obj/machinery/field_generator/Destroy()
|
||||
src.cleanup()
|
||||
..()
|
||||
return ..()
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
|
||||
/obj/singularity/Destroy()
|
||||
processing_objects.Remove(src)
|
||||
..()
|
||||
return ..()
|
||||
|
||||
/obj/singularity/Move(atom/newloc, direct)
|
||||
if(current_size >= STAGE_FIVE || check_turfs_in(direct))
|
||||
|
||||
@@ -219,7 +219,7 @@
|
||||
investigate_log("<font color='red'>deleted</font> at ([area.name])","singulo")
|
||||
if(terminal)
|
||||
disconnect_terminal()
|
||||
..()
|
||||
return ..()
|
||||
|
||||
// create a terminal object pointing towards the SMES
|
||||
// wires will attach to this
|
||||
|
||||
@@ -29,7 +29,7 @@ var/list/solars_list = list()
|
||||
|
||||
/obj/machinery/power/solar/Destroy()
|
||||
unset_control() //remove from control computer
|
||||
..()
|
||||
return ..()
|
||||
|
||||
//set the control of the panel to a given computer if closer than SOLAR_MAX_DIST
|
||||
/obj/machinery/power/solar/proc/set_control(var/obj/machinery/power/solar_control/SC)
|
||||
@@ -304,7 +304,7 @@ var/list/solars_list = list()
|
||||
M.unset_control()
|
||||
if(connected_tracker)
|
||||
connected_tracker.unset_control()
|
||||
..()
|
||||
return ..()
|
||||
|
||||
/obj/machinery/power/solar_control/disconnect_from_network()
|
||||
..()
|
||||
@@ -386,7 +386,7 @@ var/list/solars_list = list()
|
||||
data["connected_panels"] = connected_panels.len
|
||||
data["connected_tracker"] = (connected_tracker ? 1 : 0)
|
||||
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if (!ui)
|
||||
ui = new(user, src, ui_key, "solar_control.tmpl", name, 490, 420)
|
||||
ui.set_initial_data(data)
|
||||
@@ -446,7 +446,7 @@ var/list/solars_list = list()
|
||||
/obj/machinery/power/solar_control/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
|
||||
if(href_list["rate_control"])
|
||||
if(href_list["cdir"])
|
||||
src.cdir = dd_range(0,359,(360+src.cdir+text2num(href_list["cdir"]))%360)
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
/obj/machinery/power/tracker/Destroy()
|
||||
unset_control() //remove from control computer
|
||||
..()
|
||||
return ..()
|
||||
|
||||
//set the control of the tracker to a given computer if closer than SOLAR_MAX_DIST
|
||||
/obj/machinery/power/tracker/proc/set_control(var/obj/machinery/power/solar_control/SC)
|
||||
|
||||
@@ -229,7 +229,7 @@
|
||||
if (src.stat & BROKEN)
|
||||
user << "\blue The broken glass falls out."
|
||||
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
|
||||
getFromPool(/obj/item/weapon/shard, loc)
|
||||
PoolOrNew(/obj/item/weapon/shard, loc)
|
||||
var/obj/item/weapon/circuitboard/turbine_control/M = new /obj/item/weapon/circuitboard/turbine_control( A )
|
||||
for (var/obj/C in src)
|
||||
C.loc = src.loc
|
||||
|
||||
Reference in New Issue
Block a user