Adds Destroys.

This commit is contained in:
PsiOmega
2015-04-24 10:23:21 +02:00
parent 1ae0ad6d92
commit e7d85f8edc
91 changed files with 475 additions and 190 deletions

View File

@@ -148,7 +148,7 @@ turf/simulated
if(istype(target))
air_master.tiles_to_update.Add(target)
Del()
Destroy()
if(air_master)
if(parent)
air_master.groups_to_rebuild.Add(parent)

View File

@@ -30,7 +30,7 @@
/obj/effect/landmark/zcontroller/Destroy()
processing_objects.Remove(src)
return
return ..()
/obj/effect/landmark/zcontroller/process()
if (world.time > fast_time)

View File

@@ -76,6 +76,10 @@ var/global/list/GlobalPool = list()
D.Destroy()
D.ResetVars()
/proc/IsPooled(var/datum/D)
if(isnull(GlobalPool[D.type]) || length(GlobalPool[D.type]) == 0)
return 0
return 1
/datum/proc/Prepare(args)
if(islist(args))

View File

@@ -314,3 +314,9 @@ datum/controller/process/proc/enable()
/datum/controller/process/proc/getTicks()
return ticks
/datum/controller/process/proc/getStatName()
return name
/datum/controller/process/proc/getTickTime()
return "#[getTicks()]\t- [getLastRunTime()]"

View File

@@ -4,3 +4,7 @@
/datum/controller/process/alarm/doWork()
alarm_manager.fire()
/datum/controller/process/alarm/getStatName()
var/list/alarms = alarm_manager.active_alarms()
return ..()+"([alarms.len])"

View File

@@ -9,3 +9,6 @@
/datum/controller/process/disease/doWork()
updateQueueInstance.init(active_diseases, "process")
updateQueueInstance.Run()
/datum/controller/process/disease/getStatName()
return ..()+"([active_diseases.len])"

View File

@@ -1,7 +1,6 @@
var/datum/controller/process/garbage_collector/garbage_collector
var/list/delayed_garbage = list()
#define GC_DEBUG 1
/datum/controller/process/garbage_collector
var/garbage_collect = 1 // Whether or not to actually do work
var/collection_timeout = 300 //deciseconds to wait to let running procs finish before we just say fuck it and force del() the object
@@ -9,6 +8,7 @@ var/list/delayed_garbage = list()
var/max_forcedel_multiplier = 1 //multiplier (per-decisecond) for calculating max number of force del() calls per tick.
var/dels = 0 // number of del()'s we've done this tick
var/hard_dels = 0 // number of hard dels in total
var/list/destroyed = list() // list of refID's of things that should be garbage collected
// refID's are associated with the time at which they time out and need to be manually del()
// we do this so we aren't constantly locating them and preventing them from being gc'd
@@ -60,6 +60,7 @@ var/list/delayed_garbage = list()
logging["[A.type]"]++
del(A)
++dels
++hard_dels
#ifdef GC_DEBUG
else
testing("GC: [refID] properly GC'd at [world.time] with timeout [GCd_at_time]")
@@ -76,6 +77,8 @@ var/list/delayed_garbage = list()
destroyed -= "\ref[A]" // Removing any previous references that were GC'd so that the current object will be at the end of the list.
destroyed["\ref[A]"] = world.time
/datum/controller/process/garbage_collector/getStatName()
return ..()+"([garbage_collector.dels]/[garbage_collector.hard_dels])"
// Should be treated as a replacement for the 'del' keyword.
// Datums passed to this will be given a chance to clean up references to allow the GC to collect them.
@@ -92,6 +95,7 @@ var/list/delayed_garbage = list()
//warning("qdel() passed object of type [A.type]. qdel() can only handle /datum types.")
del(A)
garbage_collector.dels++
garbage_collector.hard_dels++
else if(isnull(A.gcDestroyed))
// Let our friend know they're about to get collected
. = !A.Destroy()
@@ -99,9 +103,15 @@ var/list/delayed_garbage = list()
A.finalize_qdel()
/datum/proc/finalize_qdel()
if(IsPooled(src))
PlaceInPool(src)
else
del(src)
/atom/finalize_qdel()
if(IsPooled(src))
PlaceInPool(src)
else
if(garbage_collector)
garbage_collector.AddTrash(src)
else
@@ -126,7 +136,6 @@ var/list/delayed_garbage = list()
tag = null
return
#define TESTING 1
#ifdef TESTING
/client/var/running_find_references

View File

@@ -42,3 +42,7 @@
#endif
scheck()
/datum/controller/process/machinery/getStatName()
return ..()+"([machines.len])"

View File

@@ -18,3 +18,6 @@
if(updateQueueInstance)
updateQueueInstance.init(mob_list, "Life")
updateQueueInstance.Run()
/datum/controller/process/mob/getStatName()
return ..()+"([mob_list.len])"

View File

@@ -9,3 +9,6 @@
/datum/controller/process/nanoui/doWork()
updateQueueInstance.init(nanomanager.processing_uis, "process")
updateQueueInstance.Run()
/datum/controller/process/nanoui/getStatName()
return ..()+"([nanomanager.processing_uis.len])"

View File

@@ -19,3 +19,6 @@ var/global/list/object_profiling = list()
if(updateQueueInstance)
updateQueueInstance.init(processing_objects, "process")
updateQueueInstance.Run()
/datum/controller/process/obj/getStatName()
return ..()+"([processing_objects.len])"

View File

@@ -10,3 +10,6 @@
continue
pipe_networks.Remove(pipeNetwork)
/datum/controller/process/pipenet/getStatName()
return ..()+"([pipe_networks.len])"

View File

@@ -10,3 +10,6 @@
continue
powernets.Remove(powerNetwork)
/datum/controller/process/powernet/getStatName()
return ..()+"([powernets.len])"

View File

@@ -93,7 +93,7 @@ sd_alert
response
list/validation
Del()
Destroy()
target << browse(null,"window=\ref[src]")
..()

View File

@@ -24,10 +24,12 @@
/atom/Destroy()
. = ..()
density = 0
SetOpacity(0)
if(reagents)
qdel(reagents)
reagents = null
for(var/atom/movable/AM in contents)
qdel(AM)
invisibility = 101

View File

@@ -22,6 +22,11 @@
new/mob/living/simple_animal/hostile/blobspore(src.loc, src)
return 1
/obj/effect/blob/factory/Destroy()
for(var/mob/living/simple_animal/hostile/blobspore/spore in spores)
if(spore.factory == src)
spore.factory = null
..()
/mob/living/simple_animal/hostile/blobspore
name = "blob"
@@ -58,9 +63,10 @@
..(loc)
return
death()
..()
if(factory)
factory.spores -= src
..()
qdel(src)
/mob/living/simple_animal/hostile/blobspore/Destroy()
if(factory)
factory.spores -= src
factory = null
..()

View File

@@ -31,7 +31,7 @@
return
Del()
Destroy()
blobs -= src
..()
return
@@ -212,7 +212,7 @@
icon_state = "blobidle0"
Del()
Destroy()
var/obj/effect/blob/B = new /obj/effect/blob( src.loc )
spawn(30)
B.Life()

View File

@@ -97,6 +97,10 @@
pass_flags = PASSTABLE | PASSGRILLE
power = 2
/obj/effect/meteor/Destroy()
walk(src,0) //this cancels the walk_towards() proc
..()
/obj/effect/meteor/Bump(atom/A)
spawn(0)

View File

@@ -48,6 +48,9 @@
if(bomb.timing)
user << "Extreme danger. Arming signal detected. Time remaining: [bomb.timeleft]"
/obj/item/weapon/pinpointer/Destroy()
active = 0
..()
/obj/item/weapon/pinpointer/advpinpointer
name = "Advanced Pinpointer"

View File

@@ -98,6 +98,10 @@
TLV["temperature"] = list(20, 40, 140, 160) // K
target_temperature = 90
/obj/machinery/alarm/Destroy()
if(radio_controller)
radio_controller.remove_object(src, frequency)
..()
/obj/machinery/alarm/New(var/loc, var/dir, var/building = 0)
..()

View File

@@ -73,6 +73,11 @@
if(radio_controller)
set_frequency(frequency)
obj/machinery/air_sensor/Destroy()
if(radio_controller)
radio_controller.remove_object(src,frequency)
..()
/obj/machinery/computer/general_air_control
icon = 'icons/obj/computer.dmi'
icon_state = "tank"
@@ -86,6 +91,11 @@
var/datum/radio_frequency/radio_connection
circuit = /obj/item/weapon/circuitboard/air_management
obj/machinery/computer/general_air_control/Destroy()
if(radio_controller)
radio_controller.remove_object(src, frequency)
..()
/obj/machinery/computer/general_air_control/attack_hand(mob/user)
if(..(user))
return

View File

@@ -20,6 +20,10 @@
return 1
/obj/machinery/portable_atmospherics/Destroy()
del(air_contents)
..()
/obj/machinery/portable_atmospherics/initialize()
. = ..()
spawn()

View File

@@ -15,7 +15,6 @@
var/locked = 1
//var/emagged = 0 //Urist: Moving that var to the general /bot tree as it's used by most bots
/obj/machinery/bot/proc/turn_on()
if(stat) return 0
on = 1

View File

@@ -58,6 +58,10 @@
if(radio_controller)
radio_controller.add_object(src, beacon_freq, filter = RADIO_NAVBEACONS)
/obj/machinery/bot/cleanbot/Destroy()
if(radio_controller)
radio_controller.remove_object(src,beacon_freq)
..()
/obj/machinery/bot/cleanbot/turn_on()
. = ..()

View File

@@ -76,6 +76,12 @@
suffix = "#[count]"
name = "Mulebot ([suffix])"
/obj/machinery/bot/mulebot/Destroy()
if(radio_controller)
radio_controller.remove_object(src,beacon_freq)
radio_controller.remove_object(src,control_freq)
..()
// attack by item
// emag : lock/unlock,
// screwdriver: open/close hatch

View File

@@ -107,6 +107,11 @@
if((lasercolor == "r") && (name == created_name))
name = pick("RED RAMPAGE","RED ROVER","RED KILLDEATH MURDERBOT")
/obj/machinery/bot/mulebot/Destroy()
if(radio_controller)
radio_controller.remove_object(src,beacon_freq)
radio_controller.remove_object(src,control_freq)
..()
/obj/machinery/bot/secbot/update_icon()
if(on && is_attacking)

View File

@@ -53,6 +53,14 @@
ASSERT(src.network.len > 0)
..()
/obj/machinery/camera/Destroy()
deactivate(null, 0) //kick anyone viewing out
if(assembly)
qdel(assembly)
assembly = null
qdel(wires)
..()
/obj/machinery/camera/emp_act(severity)
if(!isEmpProof())
if(prob(100/severity))

View File

@@ -185,7 +185,7 @@
else
stat &= ~NOPOWER
Del()
Destroy()
if(istype(loc,/obj/item/device/laptop))
var/obj/O = loc
spawn(5)

View File

@@ -25,8 +25,10 @@
initialize_directions = dir
/obj/machinery/atmospherics/unary/cryo_cell/Destroy()
if(occupant)
occupant.loc = loc
var/turf/T = loc
T.contents += contents
if(beaker)
beaker.loc = get_step(loc, SOUTH) //Beaker is carefully ejected from the wreckage of the cryotube
..()
/obj/machinery/atmospherics/unary/cryo_cell/initialize()

View File

@@ -142,8 +142,10 @@ obj/machinery/door/airlock/New()
if(radio_controller)
set_frequency(frequency)
obj/machinery/door/airlock/Destroy()
if(frequency && radio_controller)
radio_controller.remove_object(src,frequency)
..()
obj/machinery/airlock_sensor
icon = 'icons/obj/airlock_machines.dmi'
@@ -215,6 +217,10 @@ obj/machinery/airlock_sensor/New()
if(radio_controller)
set_frequency(frequency)
obj/machinery/airlock_sensor/Destroy()
if(radio_controller)
radio_controller.remove_object(src,frequency)
..()
obj/machinery/airlock_sensor/airlock_interior
command = "cycle_interior"
@@ -283,6 +289,11 @@ obj/machinery/access_button/New()
if(radio_controller)
set_frequency(frequency)
obj/machinery/access_button/Destroy()
if(radio_controller)
radio_controller.remove_object(src, frequency)
..()
obj/machinery/access_button/airlock_interior
frequency = 1379
command = "cycle_interior"

View File

@@ -13,6 +13,11 @@
..()
air_connection = new
/obj/machinery/door/airlock/alarmlock/Destroy()
if(radio_controller)
radio_controller.remove_object(src,air_frequency)
..()
/obj/machinery/door/airlock/alarmlock/initialize()
..()
radio_controller.remove_object(src, air_frequency)

View File

@@ -68,7 +68,6 @@
update_nearby_tiles(need_rebuild=1)
return
/obj/machinery/door/Destroy()
density = 0
update_nearby_tiles()

View File

@@ -9,6 +9,11 @@
var/on = 1
obj/machinery/embedded_controller/radio/Destroy()
if(radio_controller)
radio_controller.remove_object(src,frequency)
..()
/obj/machinery/embedded_controller/proc/post_signal(datum/signal/signal, comm_line)
return 0

View File

@@ -49,7 +49,7 @@ Class Variables:
Class Procs:
New() 'game/machinery/machine.dm'
Del() 'game/machinery/machine.dm'
Destroy() 'game/machinery/machine.dm'
auto_use_power() 'game/machinery/machine.dm'
This proc determines how power mode power is deducted by the machine.

View File

@@ -190,8 +190,10 @@
pulling = 0
/obj/machinery/magnetic_module/Destroy()
if(radio_controller)
radio_controller.remove_object(src, freq)
..()
/obj/machinery/magnetic_controller
name = "Magnetic Control Console"
@@ -399,25 +401,7 @@
// there doesn't HAVE to be separators but it makes paths syntatically visible
/obj/machinery/magnetic_controller/Destroy()
if(radio_controller)
radio_controller.remove_object(src, frequency)
..()

View File

@@ -240,6 +240,7 @@ Transponder Codes:<UL>"}
updateDialog()
/obj/machinery/navbeacon/Destroy()
if(radio_controller)
radio_controller.remove_object(src, freq)
..()

View File

@@ -80,37 +80,48 @@ var/list/obj/machinery/requests_console/allConsoles = list()
//req_console_departments += department
switch(departmentType)
if(1)
if(!("[department]" in req_console_assistance))
req_console_assistance += department
req_console_assistance |= department
if(2)
if(!("[department]" in req_console_supplies))
req_console_supplies += department
req_console_supplies |= department
if(3)
if(!("[department]" in req_console_information))
req_console_information += department
req_console_information |= department
if(4)
if(!("[department]" in req_console_assistance))
req_console_assistance += department
if(!("[department]" in req_console_supplies))
req_console_supplies += department
req_console_assistance |= department
req_console_supplies |= department
if(5)
if(!("[department]" in req_console_assistance))
req_console_assistance += department
if(!("[department]" in req_console_information))
req_console_information += department
req_console_assistance |= department
req_console_information |= department
if(6)
if(!("[department]" in req_console_supplies))
req_console_supplies += department
if(!("[department]" in req_console_information))
req_console_information += department
req_console_supplies |= department
req_console_information |= department
if(7)
if(!("[department]" in req_console_assistance))
req_console_assistance += department
if(!("[department]" in req_console_supplies))
req_console_supplies += department
if(!("[department]" in req_console_information))
req_console_information += department
req_console_assistance |= department
req_console_supplies |= department
req_console_information |= department
/obj/machinery/requests_console/Destroy()
allConsoles -= src
switch(departmentType)
if(1)
req_console_assistance -= department
if(2)
req_console_supplies -= department
if(3)
req_console_information -= department
if(4)
req_console_assistance -= department
req_console_supplies -= department
if(5)
req_console_assistance -= department
req_console_information -= department
if(6)
req_console_supplies -= department
req_console_information -= department
if(7)
req_console_assistance -= department
req_console_supplies -= department
req_console_information -= department
..()
/obj/machinery/requests_console/attack_hand(user as mob)
if(..(user))

View File

@@ -45,6 +45,11 @@
var/const/STATUS_DISPLAY_TIME = 4
var/const/STATUS_DISPLAY_CUSTOM = 99
/obj/machinery/status_display/Destroy()
if(radio_controller)
radio_controller.remove_object(src,frequency)
..()
// register for radio system
/obj/machinery/status_display/initialize()
..()

View File

@@ -130,9 +130,11 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
for(var/obj/machinery/telecomms/T in telecomms_list)
add_link(T)
/obj/machinery/telecomms/Destroy()
telecomms_list -= src
for(var/obj/machinery/telecomms/comm in telecomms_list)
comm.links -= src
links = list()
..()
// Used in auto linking

View File

@@ -146,7 +146,6 @@
/obj/machinery/vending/Destroy()
qdel(wires)
wires = null
if(coin)
qdel(coin)
coin = null
..()

View File

@@ -17,7 +17,7 @@ var/list/obj/effect/bump_teleporter/BUMP_TELEPORTERS = list()
/obj/effect/bump_teleporter/Destroy()
BUMP_TELEPORTERS -= src
..()
return ..()
/obj/effect/bump_teleporter/Bumped(atom/user)
if(!ismob(user))

View File

@@ -24,7 +24,7 @@ var/global/list/image/splatter_cache=list()
/obj/effect/decal/cleanable/blood/Destroy()
for(var/datum/disease/D in viruses)
D.cure(0)
..()
return ..()
/obj/effect/decal/cleanable/blood/New()
..()

View File

@@ -23,8 +23,7 @@ would spawn and follow the beaker, even if it is carried or thrown.
/obj/effect/Destroy()
if(reagents)
reagents.delete()
PlaceInPool(src)
return 1
return ..()
/obj/effect/effect/water/Move(turf/newloc)
//var/turf/T = src.loc
@@ -140,8 +139,7 @@ steam.start() -- spawns the effect
var/turf/T = src.loc
if (istype(T, /turf))
T.hotspot_expose(1000,100)
..()
return
return ..()
/obj/effect/effect/sparks/Move()
..()

View File

@@ -83,7 +83,7 @@
/obj/effect/landmark/Destroy()
landmarks_list -= src
..()
return ..()
/obj/effect/landmark/start
name = "start"
@@ -103,7 +103,8 @@
/obj/effect/landmark/start/ninja/New()
..()
ninjastart += src
ninjastart += loc
qdel(src)
//Costume spawner landmarks

View File

@@ -3,10 +3,6 @@
unacidable = 1
var/i_attached//Added for possible image attachments to objects. For hallucinations and the like.
/obj/effect/overlay/Destroy()
PlaceInPool(src)
return 1 //cancels the GCing
/obj/effect/overlay/beam//Not actually a projectile, just an effect.
name="beam"
icon='icons/effects/beam.dmi'

View File

@@ -209,4 +209,4 @@
src.visible_message("\red \the [src] splits open.")
for(var/atom/movable/A in contents)
A.loc = src.loc
..()
return ..()

View File

@@ -115,7 +115,9 @@
spawn(5)
radio = new /obj/item/radio/integrated/signal(src)
/obj/item/weapon/cartridge/signal/Destroy()
qdel(radio)
..()
/obj/item/weapon/cartridge/quartermaster
name = "\improper Space Parts & Space Vendors cartridge"

View File

@@ -99,6 +99,12 @@
post_signal(control_freq, "command", "summon", "active", active, "target", get_turf(PDA) , s_filter = RADIO_SECBOT)
post_signal(control_freq, "command", "bot_status", "active", active, s_filter = RADIO_SECBOT)
/obj/item/radio/integrated/beepsky/Destroy()
if(radio_controller)
radio_controller.remove_object(src, control_freq)
..()
/obj/item/radio/integrated/mule
var/list/botlist = null // list of bots
var/obj/machinery/bot/mulebot/active // the active bot; if null, show bot list
@@ -245,3 +251,8 @@
radio_connection.post_signal(src, signal)
return
/obj/item/radio/integrated/signal/Destroy()
if(radio_controller)
radio_controller.remove_object(src, frequency)
..()

View File

@@ -29,6 +29,8 @@
/obj/item/device/radio/headset/Destroy()
qdel(keyslot1)
qdel(keyslot2)
keyslot1 = null
keyslot2 = null
..()
/obj/item/device/radio/headset/examine(mob/user)

View File

@@ -45,6 +45,15 @@
if(radio_controller)
initialize()
/obj/item/device/radio/Destroy()
qdel(wires)
wires = null
if(radio_controller)
radio_controller.remove_object(src, frequency)
for (var/ch_name in channels)
radio_controller.remove_object(src, radiochannels[ch_name])
..()
/obj/item/device/radio/initialize()
@@ -625,7 +634,6 @@
onclose(user, "radio")
return
/obj/item/device/radio/proc/config(op)
if(radio_controller)
for (var/ch_name in channels)

View File

@@ -9,7 +9,7 @@
var/icon/virtualIcon
var/list/bulletholes = list()
Del()
Destroy()
// if a target is deleted and associated with a stake, force stake to forget
for(var/obj/structure/target_stake/T in view(3,src))
if(T.pinned_target == src)

View File

@@ -31,10 +31,10 @@
/obj/item/stack/Destroy()
if(uses_charge)
return
return 1
if (src && usr && usr.machine == src)
usr << browse(null, "window=stack")
..()
return ..()
/obj/item/stack/examine(mob/user)
if(..(user, 1))

View File

@@ -40,6 +40,11 @@
spark_system.set_up(5, 0, src)
spark_system.attach(src)
/obj/item/weapon/rcd/Destroy()
qdel(spark_system)
spark_system = null
return ..()
/obj/item/weapon/rcd/attackby(obj/item/weapon/W, mob/user)
if(istype(W, /obj/item/weapon/rcd_ammo))

View File

@@ -46,7 +46,7 @@
icon_state = "implant_melted"
malfunction = MALFUNCTION_PERMANENT
Del()
Destroy()
if(part)
part.implants.Remove(src)
..()

View File

@@ -10,6 +10,10 @@
verbs -= /obj/item/verb/verb_pickup //make sure this is never picked up.
..()
/obj/item/weapon/storage/internal/Destroy()
master_item = null
..()
/obj/item/weapon/storage/internal/attack_hand()
return //make sure this is never picked up

View File

@@ -11,6 +11,7 @@
w_class = 3
var/list/can_hold = new/list() //List of objects which this item can store (if set, it can't store anything else)
var/list/cant_hold = new/list() //List of objects which this item can't store (in effect only if can_hold isn't set)
var/list/is_seeing = new/list() //List of mobs which are currently seeing the contents of this item's storage
var/max_w_class = 2 //Max size of objects that this object can store (in effect only if can_hold isn't set)
var/max_storage_space = 14 //The sum of the storage costs of all the items in this storage item.
var/storage_slots = 7 //The number of storage slots in this container.
@@ -23,6 +24,12 @@
var/collection_mode = 1; //0 = pick one at a time, 1 = pick all on tile
var/use_sound = "rustle" //sound played when used. null for no sound.
/obj/item/weapon/storage/Destroy()
close_all()
qdel(boxes)
qdel(closer)
..()
/obj/item/weapon/storage/MouseDrop(obj/over_object as obj)
if(!canremove)
@@ -86,6 +93,7 @@
user.client.screen += src.closer
user.client.screen += src.contents
user.s_active = src
is_seeing |= user
return
/obj/item/weapon/storage/proc/hide_from(mob/user as mob)
@@ -97,7 +105,7 @@
user.client.screen -= src.contents
if(user.s_active == src)
user.s_active = null
return
is_seeing -= user
/obj/item/weapon/storage/proc/open(mob/user as mob)
if (src.use_sound)
@@ -109,11 +117,24 @@
show_to(user)
/obj/item/weapon/storage/proc/close(mob/user as mob)
src.hide_from(user)
user.s_active = null
return
/obj/item/weapon/storage/proc/close_all()
for(var/mob/M in can_see_contents())
close(M)
. = 1
/obj/item/weapon/storage/proc/can_see_contents()
var/list/cansee = list()
for(var/mob/M in is_seeing)
if(M.s_active == src && M.client)
cansee |= M
else
is_seeing -= M
return cansee
//This proc draws out the inventory and places the items on it. tx and ty are the upper left tile and mx, my are the bottm right.
//The numbers are calculated from the bottom-left The bottom-left slot being 1,1.
/obj/item/weapon/storage/proc/orient_objs(tx, ty, mx, my)

View File

@@ -6,10 +6,11 @@
var/parts
/obj/structure/Destroy()
..()
if(opacity)
UpdateAffectingLights()
if(parts)
new parts(loc)
density = 0
..()
/obj/structure/attack_hand(mob/user)
if(breakable)

View File

@@ -22,7 +22,7 @@
name = "[mineralType] door"
update_nearby_tiles(need_rebuild=1)
Del()
Destroy()
update_nearby_tiles()
..()

View File

@@ -102,7 +102,7 @@ var/list/mechtoys = list(
T.blocks_air = 1
..()
Del() //lazy hack to set the turf to allow air to pass if it's a simulated floor
Destroy() //lazy hack to set the turf to allow air to pass if it's a simulated floor
var/turf/T = get_turf(loc)
if(T)
if(istype(T, /turf/simulated/floor))

View File

@@ -17,5 +17,5 @@
flick("turf_animation",c_animation)
spawn(10)
if(c_animation)
PlaceInPool(c_animation)
qdel(c_animation)
c_animation = null

View File

@@ -259,6 +259,9 @@
return
/obj/effect/beam/i_beam/Destroy()
if(master.first == src)
master.first = null
if(next)
qdel(next)
next = null
..()
return

View File

@@ -141,6 +141,8 @@
proc/set_frequency(new_frequency)
if(!frequency)
return
if(!radio_controller)
sleep(20)
if(!radio_controller)
@@ -170,3 +172,9 @@
deadman = 1
processing_objects.Add(src)
usr.visible_message("\red [usr] moves their finger over [src]'s signal button...")
/obj/item/device/assembly/signaler/Destroy()
if(radio_controller)
radio_controller.remove_object(src,frequency)
frequency = 0
..()

View File

@@ -8,6 +8,11 @@
pockets.max_w_class = 2 //fit only pocket sized items
pockets.max_storage_space = 4
/obj/item/clothing/suit/storage/Destroy()
qdel(pockets)
pockets = null
..()
/obj/item/clothing/suit/storage/attack_hand(mob/user as mob)
if (pockets.handle_attack_hand(user))
..(user)
@@ -59,7 +64,6 @@
pockets.max_w_class = 2
pockets.max_storage_space = 8
/obj/item/clothing/suit/storage/vest
var/icon_badge
var/icon_nobadge

View File

@@ -3,7 +3,7 @@
// The datum containing all the chunks.
/datum/visualnet/camera
// The cameras on the map, no matter if they work or not. Updated in obj/machinery/camera.dm by New() and Del().
// The cameras on the map, no matter if they work or not. Updated in obj/machinery/camera.dm by New() and Destroy().
var/list/cameras = list()
var/cameras_unsorted = 1
chunk_type = /datum/chunk/camera

View File

@@ -43,6 +43,7 @@
if(eyeobj)
eyeobj.owner = null
qdel(eyeobj) // No AI, no Eye
eyeobj = null
..()
/atom/proc/move_camera_by_click()

View File

@@ -20,7 +20,7 @@
HOW IT WORKS
It works by first creating a camera network datum. Inside of this camera network are "chunks" (which will be
explained later) and "cameras". The cameras list is kept up to date by obj/machinery/camera/New() and Del().
explained later) and "cameras". The cameras list is kept up to date by obj/machinery/camera/New() and Destroy().
Next the camera network has chunks. These chunks are a 16x16 tile block of turfs and cameras contained inside the chunk.
These turfs are then sorted out based on what the cameras can and cannot see. If none of the cameras can see the turf, inside

View File

@@ -36,7 +36,7 @@
/obj/effect/Destroy()
updateVisibility(src)
..()
return ..()
/obj/effect/New()
..()

View File

@@ -115,6 +115,15 @@
locked = 1
return
/obj/item/device/mmi/Destroy()
if(isrobot(loc))
var/mob/living/silicon/robot/borg = loc
borg.mmi = null
if(brainmob)
qdel(brainmob)
brainmob = null
..()
/obj/item/device/mmi/radio_enabled
name = "radio-enabled man-machine interface"
desc = "The Warrior's bland acronym, MMI, obscures the true horror of this monstrosity. This one comes with a built-in radio."

View File

@@ -15,7 +15,7 @@
R.my_atom = src
..()
Del()
Destroy()
if(key) //If there is a mob connected to this thing. Have to check key twice to avoid false death reporting.
if(stat!=DEAD) //If not dead.
death(1) //Brains can die again. AND THEY SHOULD AHA HA HA HA HA HA

View File

@@ -27,6 +27,12 @@
if(brainmob && brainmob.client)
brainmob.client.screen.len = null //clear the hud
/obj/item/organ/brain/Destroy()
if(brainmob)
qdel(brainmob)
brainmob = null
..()
/obj/item/organ/brain/proc/transfer_identity(var/mob/living/carbon/H)
name = "\the [H]'s [initial(src.name)]"
brainmob = new(src)

View File

@@ -7,6 +7,13 @@
if(germ_level < GERM_LEVEL_AMBIENT && prob(30)) //if you're just standing there, you shouldn't get more germs beyond an ambient level
germ_level++
/mob/living/carbon/Destroy()
for(var/guts in internal_organs)
qdel(guts)
for(var/food in stomach_contents)
qdel(food)
return ..()
/mob/living/carbon/Move(NewLoc, direct)
. = ..()
if(.)

View File

@@ -47,6 +47,11 @@
dna.real_name = real_name
make_blood()
/mob/living/carbon/human/Destroy()
for(var/organ in organs)
qdel(organ)
return ..()
/mob/living/carbon/human/Stat()
..()
statpanel("Status")

View File

@@ -244,7 +244,7 @@ var/list/ai_verbs_default = list(
/obj/machinery/ai_powersupply/New(var/mob/living/silicon/ai/ai=null)
powered_ai = ai
if(isnull(powered_ai))
Del()
qdel(src)
loc = powered_ai.loc
use_power(1) // Just incase we need to wake up the power system.
@@ -253,7 +253,7 @@ var/list/ai_verbs_default = list(
/obj/machinery/ai_powersupply/process()
if(!powered_ai || powered_ai.stat & DEAD)
Del()
qdel(src)
if(!powered_ai.anchored)
loc = powered_ai.loc
use_power = 0

View File

@@ -228,11 +228,18 @@
//If there's an MMI in the robot, have it ejected when the mob goes away. --NEO
//Improved /N
/mob/living/silicon/robot/Destroy()
if(mmi)//Safety for when a cyborg gets dust()ed. Or there is no MMI inside.
if(mmi && mind)//Safety for when a cyborg gets dust()ed. Or there is no MMI inside.
var/turf/T = get_turf(loc)//To hopefully prevent run time errors.
if(T) mmi.loc = T
if(mind) mind.transfer_to(mmi.brainmob)
if(mmi.brainmob)
mind.transfer_to(mmi.brainmob)
else
src << "<span class='danger'>Oops! Something went very wrong, your MMI was unable to receive your mind. You have been ghosted. Please make a bug report so we can fix this bug.</span>"
ghostize()
//ERROR("A borg has been destroyed, but its MMI lacked a brainmob, so the mind could not be transferred. Player: [ckey].")
mmi = null
if(connected_ai)
connected_ai.connected_robots -= src
..()
/mob/living/silicon/robot/proc/pick_module()
@@ -662,7 +669,7 @@
C.r_arm = new/obj/item/robot_parts/r_arm(C)
C.updateicon()
new/obj/item/robot_parts/chest(loc)
src.Del()
qdel(src)
else
// Okay we're not removing the cell or an MMI, but maybe something else?
var/list/removable_components = list()

View File

@@ -11,6 +11,17 @@
var/obj/item/emag = null
var/obj/item/borg/upgrade/jetpack = null
/obj/item/weapon/robot_module/Destroy()
qdel(modules)
qdel(synths)
qdel(emag)
qdel(jetpack)
modules = null
synths = null
emag = null
jetpack = null
..()
/obj/item/weapon/robot_module/emp_act(severity)
if(modules)
for(var/obj/O in modules)

View File

@@ -210,7 +210,7 @@
held_item = null
gibs(loc, viruses, null, null, /obj/effect/gibspawner/robot) //TODO: use gib() or refactor spiderbots into synthetics.
src.Del()
qdel(src)
return
//Cannibalized from the parrot mob. ~Zuhayr

View File

@@ -98,7 +98,7 @@
return
Del() //if a chunk a destroyed, make a new worm out of the split halves
Destroy() //if a chunk a destroyed, make a new worm out of the split halves
if(previous)
previous.Detach()
..()

View File

@@ -2,6 +2,11 @@
mob_list -= src
dead_mob_list -= src
living_mob_list -= src
qdel(hud_used)
if(mind && mind.current == src)
spellremove(src)
for(var/infection in viruses)
qdel(infection)
ghostize()
..()
@@ -726,52 +731,11 @@ note dizziness decrements automatically in the mob's Life() proc.
statpanel("Status","CPU:","[world.cpu]")
statpanel("Status","Instances:","[world.contents.len]")
if(statpanel("Status") && processScheduler && processScheduler.getIsRunning())
var/datum/controller/process/process
process = processScheduler.getProcess("air")
statpanel("Status",process.name, "#[process.getTicks()]\t- [process.getLastRunTime()]")
process = processScheduler.getProcess("alarm")
var/list/alarms = alarm_manager.active_alarms()
statpanel("Status",process.name+"([alarms.len])","#[process.getTicks()]\t- [process.getLastRunTime()]")
process = processScheduler.getProcess("disease")
statpanel("Status",process.name+"([active_diseases.len])","#[process.getTicks()]\t- [process.getLastRunTime()]")
process = processScheduler.getProcess("garbage")
statpanel("Status",process.name+"([garbage_collector.dels])","#[process.getTicks()]\t- [process.getLastRunTime()]")
process = processScheduler.getProcess("machinery")
statpanel("Status",process.name+"([machines.len])","#[process.getTicks()]\t- [process.getLastRunTime()]")
process = processScheduler.getProcess("mob")
statpanel("Status",process.name+"([mob_list.len])","#[process.getTicks()]\t- [process.getLastRunTime()]")
process = processScheduler.getProcess("nanoui")
statpanel("Status",process.name+"([nanomanager.processing_uis.len])","t#[process.getTicks()]\t- [process.getLastRunTime()]")
process = processScheduler.getProcess("lighting")
statpanel("Status",process.name, "#[process.getTicks()]\t- [process.getLastRunTime()]")
process = processScheduler.getProcess("obj")
statpanel("Status",process.name+"([processing_objects.len])","#[process.getTicks()]\t- [process.getLastRunTime()]")
process = processScheduler.getProcess("pipenet")
statpanel("Status",process.name+"([pipe_networks.len])","#[process.getTicks()]\t- [process.getLastRunTime()]")
process = processScheduler.getProcess("powernet")
statpanel("Status",process.name+"([powernets.len])","#[process.getTicks()]\t- [process.getLastRunTime()]")
process = processScheduler.getProcess("sun")
statpanel("Status",process.name, "#[process.getTicks()]\t- [process.getLastRunTime()]")
process = processScheduler.getProcess("ticker")
statpanel("Status",process.name, "#[process.getTicks()]\t- [process.getLastRunTime()]")
for(var/datum/controller/process/P in processScheduler.processes)
statpanel("Status",P.getStatName(), P.getTickTime())
else
statpanel("Status","processScheduler is not running.")
if(listed_turf && client)
if(!TurfAdjacent(listed_turf))
listed_turf = null

View File

@@ -37,7 +37,14 @@
/obj/item/weapon/grab/Destroy()
//make sure the grabbed_by list doesn't fill up with nulls
if(affecting) affecting.grabbed_by -= src
if(affecting)
affecting.grabbed_by -= src
affecting = null
if(assailant)
if(assailant.client)
assailant.client.screen -= hud
assailant = null
qdel(hud)
..()
//Used by throw code to hand over the mob, instead of throwing the grab. The grab is then deleted by the throw code.

View File

@@ -61,7 +61,6 @@ field_generator power level display
connected_gens = list()
return
/obj/machinery/field_generator/process()
if(Varedit_start == 1)
if(active == 0)

View File

@@ -72,6 +72,12 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin
var/strength = null
var/desc_holder = null
/obj/structure/particle_accelerator/Destroy()
construction_state = 0
if(master)
master.part_scan()
..()
/obj/structure/particle_accelerator/end_cap
name = "Alpha Particle Generation Array"
desc_holder = "This is where Alpha particles are generated from \[REDACTED\]"

View File

@@ -27,6 +27,10 @@
active_power_usage = initial(active_power_usage) * (strength + 1)
..()
/obj/machinery/particle_accelerator/control_box/Destroy()
if(active)
toggle_power()
..()
/obj/machinery/particle_accelerator/control_box/attack_hand(mob/user as mob)
if(construction_state >= 3)

View File

@@ -83,6 +83,12 @@
return
/obj/machinery/power/smes/Destroy()
if(terminal)
disconnect_terminal()
..()
/obj/machinery/power/smes/update_icon()
overlays.Cut()
if(stat & BROKEN) return

View File

@@ -43,7 +43,7 @@
user << "[src] shatters into a scattering of overstressed metal shards as it leaves the crossbow."
var/obj/item/weapon/shard/shrapnel/S = new()
S.loc = get_turf(src)
src.Del()
qdel(src)
/obj/item/weapon/gun/launcher/crossbow
name = "powered crossbow"

View File

@@ -649,6 +649,15 @@ datum
return trans_data
datum/reagents/Destroy()
..()
for(var/datum/reagent/R in reagent_list)
qdel(R)
reagent_list.Cut()
reagent_list = null
if(my_atom && my_atom.reagents == src)
my_atom.reagents = null
///////////////////////////////////////////////////////////////////////////////////

View File

@@ -162,7 +162,7 @@ datum
/* Must check the transfering of reagents and their data first. They all can point to one disease datum.
Del()
Destroy()
if(src.data["virus"])
var/datum/disease/D = src.data["virus"]
D.cure(0)
@@ -1790,7 +1790,7 @@ datum
..()
return
Del()
Destroy()
if(holder && ismob(holder.my_atom))
var/mob/M = holder.my_atom
M.status_flags &= ~FAKEDEATH
@@ -4428,5 +4428,9 @@ datum
..()
return
datum/reagent/Destroy() // This should only be called by the holder, so it's already handled clearing its references
..()
holder = null
// Undefine the alias for REAGENTS_EFFECT_MULTIPLER
#undef REM

View File

@@ -43,6 +43,11 @@
air_contents.volume = PRESSURE_TANK_VOLUME
update()
/obj/machinery/disposal/Destroy()
eject()
if(trunk)
trunk.linked = null
..()
// attack by item places it in to disposal
/obj/machinery/disposal/attackby(var/obj/item/I, var/mob/user)
@@ -638,6 +643,11 @@
location.assume_air(gas) // vent all gas to turf
return
/obj/structure/disposalholder/Destroy()
qdel(gas)
active = 0
..()
// Disposal pipes
/obj/structure/disposalpipe
@@ -663,7 +673,7 @@
// pipe is deleted
// ensure if holder is present, it is expelled
Del()
Destroy()
var/obj/structure/disposalholder/H = locate() in src
if(H)
// holder was present
@@ -920,6 +930,30 @@
qdel(src)
// pipe is deleted
// ensure if holder is present, it is expelled
/obj/structure/disposalpipe/Destroy()
var/obj/structure/disposalholder/H = locate() in src
if(H)
// holder was present
H.active = 0
var/turf/T = src.loc
if(T.density)
// deleting pipe is inside a dense turf (wall)
// this is unlikely, but just dump out everything into the turf in case
for(var/atom/movable/AM in H)
AM.loc = T
AM.pipe_eject(0)
qdel(H)
..()
return
// otherwise, do normal expel from turf
if(H)
expel(H, T, 0)
..()
// *** TEST verb
//client/verb/dispstop()
// for(var/obj/structure/disposalholder/H in world)
@@ -1468,8 +1502,6 @@
user << "You need more welding fuel to complete this task."
return
// called when movable is expelled from a disposal pipe or outlet
// by default does nothing, override for special behaviour

View File

@@ -307,6 +307,16 @@
return
/obj/structure/bigDelivery/Destroy()
if(wrapped) //sometimes items can disappear. For example, bombs. --rastaf0
wrapped.loc = (get_turf(loc))
if(istype(wrapped, /obj/structure/closet))
var/obj/structure/closet/O = wrapped
O.welded = 0
var/turf/T = get_turf(src)
for(var/atom/movable/AM in contents)
AM.loc = T
..()
/obj/item/device/destTagger
name = "destination tagger"
@@ -440,3 +450,8 @@
else
user << "You need more welding fuel to complete this task."
return
/obj/machinery/disposal/deliveryChute/Destroy()
if(trunk)
trunk.linked = null
..()

View File

@@ -153,7 +153,6 @@
collapse_shields()
..()
/obj/machinery/shieldgen/proc/shields_up()
if(active) return 0 //If it's already turned on, how did this get called?

View File

@@ -39,6 +39,12 @@
field = new/list()
..()
/obj/machinery/shield_gen/Destroy()
for(var/obj/effect/energy_field/D in field)
field.Remove(D)
D.loc = null
..()
/obj/machinery/shield_gen/attackby(obj/item/W, mob/user)
if(istype(W, /obj/item/weapon/card/id))
var/obj/item/weapon/card/id/C = W

View File

@@ -80,7 +80,7 @@
// Eject contents if deleted somehow
for(var/atom/movable/AM in src)
AM.loc = get_turf(src)
..()
return ..()
/obj/effect/dummy/spell_jaunt/relaymove(var/mob/user, direction)
if (!src.canmove || reappearing) return