mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-08-23 05:06:50 +01:00
correct behavior & use of QDEL_NULL_LIST+ odd shim
This commit is contained in:
@@ -26,8 +26,7 @@
|
||||
#define QDEL_IN(item, time) addtimer(CALLBACK(GLOBAL_PROC, .proc/qdel, item), time, TIMER_STOPPABLE)
|
||||
#define QDEL_IN_CLIENT_TIME(item, time) addtimer(CALLBACK(GLOBAL_PROC, .proc/qdel, item), time, TIMER_STOPPABLE | TIMER_CLIENT_TIME)
|
||||
#define QDEL_NULL(x) if(x) { qdel(x) ; x = null }
|
||||
#define QDEL_NULL_LIST QDEL_LIST_NULL
|
||||
#define QDEL_LIST_NULL(x) if(x) { for(var/y in x) { qdel(y) } ; x = null }
|
||||
#define QDEL_NULL_LIST(x) if (x) { for(var/y in x) { qdel(y) } }; if (x) { x.Cut(); x = null; }
|
||||
#define QDEL_LIST(L) if(L) { for(var/I in L) qdel(I); L.Cut(); }
|
||||
#define QDEL_LIST_IN(L, time) addtimer(CALLBACK(GLOBAL_PROC, .proc/______qdel_list_wrapper, L), time, TIMER_STOPPABLE)
|
||||
#define QDEL_LIST_ASSOC(L) if(L) { for(var/I in L) { qdel(L[I]); qdel(I); } L.Cut(); }
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
unapply_to_hud()
|
||||
if(needs_processing)
|
||||
STOP_PROCESSING(SSprocessing, src)
|
||||
QDEL_LIST_NULL(screenobjs)
|
||||
QDEL_NULL_LIST(screenobjs)
|
||||
return ..()
|
||||
|
||||
// Apply to a real /datum/hud
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
var/list/beam_components = list()
|
||||
|
||||
/datum/beam_components_cache/Destroy()
|
||||
QDEL_LIST_NULL(beam_components)
|
||||
QDEL_NULL_LIST(beam_components)
|
||||
return ..()
|
||||
|
||||
/proc/generate_tracer_between_points(datum/point/starting, datum/point/ending, datum/beam_components_cache/beam_components, beam_type, color, qdel_in = 5, light_range = 2, light_color_override, light_intensity = 1, instance_key) //Do not pass z-crossing points as that will not be properly (and likely will never be properly until it's absolutely needed) supported!
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
/obj/item/grenade/chem_grenade/Destroy()
|
||||
QDEL_NULL(detonator)
|
||||
QDEL_LIST_NULL(beakers)
|
||||
QDEL_NULL_LIST(beakers)
|
||||
return ..()
|
||||
|
||||
/obj/item/grenade/chem_grenade/attack_self(mob/user as mob)
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
START_PROCESSING(SSobj, src)
|
||||
else
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
QDEL_LIST_NULL(i_beams)
|
||||
QDEL_NULL_LIST(i_beams)
|
||||
return on
|
||||
|
||||
/obj/item/assembly/infra/update_icon()
|
||||
@@ -54,7 +54,7 @@
|
||||
|
||||
/obj/item/assembly/infra/process()
|
||||
if(!on && i_beams)
|
||||
QDEL_LIST_NULL(i_beams)
|
||||
QDEL_NULL_LIST(i_beams)
|
||||
return
|
||||
|
||||
if(!i_beams && secured && (istype(loc, /turf) || (holder && istype(holder.loc, /turf))))
|
||||
@@ -74,7 +74,7 @@
|
||||
I.visible = visible
|
||||
|
||||
/obj/item/assembly/infra/attack_hand()
|
||||
QDEL_LIST_NULL(i_beams)
|
||||
QDEL_NULL_LIST(i_beams)
|
||||
..()
|
||||
|
||||
/obj/item/assembly/infra/Move()
|
||||
@@ -84,19 +84,19 @@
|
||||
|
||||
/obj/item/assembly/infra/Moved(atom/old_loc, direction, forced = FALSE)
|
||||
. = ..()
|
||||
QDEL_LIST_NULL(i_beams)
|
||||
QDEL_NULL_LIST(i_beams)
|
||||
|
||||
/obj/item/assembly/infra/holder_movement()
|
||||
if(!holder)
|
||||
return FALSE
|
||||
QDEL_LIST_NULL(i_beams)
|
||||
QDEL_NULL_LIST(i_beams)
|
||||
return TRUE
|
||||
|
||||
/obj/item/assembly/infra/proc/trigger_beam()
|
||||
if(!process_cooldown())
|
||||
return FALSE
|
||||
pulse(0)
|
||||
QDEL_LIST_NULL(i_beams) //They will get recreated next process() if the situation is still appropriate
|
||||
QDEL_NULL_LIST(i_beams) //They will get recreated next process() if the situation is still appropriate
|
||||
if(!holder)
|
||||
visible_message("[bicon(src)] *beep* *beep*")
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
|
||||
/datum/plane_holder/Destroy()
|
||||
my_mob = null
|
||||
QDEL_LIST_NULL(plane_masters) //Goodbye my children, be free
|
||||
QDEL_NULL_LIST(plane_masters) //Goodbye my children, be free
|
||||
return ..()
|
||||
|
||||
/datum/plane_holder/proc/set_vis(var/which = null, var/state = FALSE)
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
return ..()
|
||||
|
||||
/obj/machinery/shield_gen/Destroy()
|
||||
QDEL_LIST_NULL(field)
|
||||
QDEL_NULL_LIST(field)
|
||||
return ..()
|
||||
|
||||
/obj/machinery/shield_gen/emag_act(var/remaining_charges, var/mob/user)
|
||||
|
||||
Reference in New Issue
Block a user