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)) if(istype(target))
air_master.tiles_to_update.Add(target) air_master.tiles_to_update.Add(target)
Del() Destroy()
if(air_master) if(air_master)
if(parent) if(parent)
air_master.groups_to_rebuild.Add(parent) air_master.groups_to_rebuild.Add(parent)

View File

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

View File

@@ -76,6 +76,10 @@ var/global/list/GlobalPool = list()
D.Destroy() D.Destroy()
D.ResetVars() 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) /datum/proc/Prepare(args)
if(islist(args)) if(islist(args))

View File

@@ -314,3 +314,9 @@ datum/controller/process/proc/enable()
/datum/controller/process/proc/getTicks() /datum/controller/process/proc/getTicks()
return ticks 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() /datum/controller/process/alarm/doWork()
alarm_manager.fire() 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() /datum/controller/process/disease/doWork()
updateQueueInstance.init(active_diseases, "process") updateQueueInstance.init(active_diseases, "process")
updateQueueInstance.Run() updateQueueInstance.Run()
/datum/controller/process/disease/getStatName()
return ..()+"([active_diseases.len])"

View File

@@ -1,14 +1,14 @@
var/datum/controller/process/garbage_collector/garbage_collector var/datum/controller/process/garbage_collector/garbage_collector
var/list/delayed_garbage = list() var/list/delayed_garbage = list()
#define GC_DEBUG 1
/datum/controller/process/garbage_collector /datum/controller/process/garbage_collector
var/garbage_collect = 1 // Whether or not to actually do work 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 var/collection_timeout = 300 //deciseconds to wait to let running procs finish before we just say fuck it and force del() the object
var/max_checks_multiplier = 5 //multiplier (per-decisecond) for calculating max number of tests per tick. These tests check if our GC'd objects are actually GC'd var/max_checks_multiplier = 5 //multiplier (per-decisecond) for calculating max number of tests per tick. These tests check if our GC'd objects are actually GC'd
var/max_forcedel_multiplier = 1 //multiplier (per-decisecond) for calculating max number of force del() calls per tick. 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/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 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() // 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 // 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]"]++ logging["[A.type]"]++
del(A) del(A)
++dels ++dels
++hard_dels
#ifdef GC_DEBUG #ifdef GC_DEBUG
else else
testing("GC: [refID] properly GC'd at [world.time] with timeout [GCd_at_time]") 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]" // 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 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. // 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. // 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.") //warning("qdel() passed object of type [A.type]. qdel() can only handle /datum types.")
del(A) del(A)
garbage_collector.dels++ garbage_collector.dels++
garbage_collector.hard_dels++
else if(isnull(A.gcDestroyed)) else if(isnull(A.gcDestroyed))
// Let our friend know they're about to get collected // Let our friend know they're about to get collected
. = !A.Destroy() . = !A.Destroy()
@@ -99,13 +103,19 @@ var/list/delayed_garbage = list()
A.finalize_qdel() A.finalize_qdel()
/datum/proc/finalize_qdel() /datum/proc/finalize_qdel()
del(src) if(IsPooled(src))
PlaceInPool(src)
else
del(src)
/atom/finalize_qdel() /atom/finalize_qdel()
if(garbage_collector) if(IsPooled(src))
garbage_collector.AddTrash(src) PlaceInPool(src)
else else
delayed_garbage |= src if(garbage_collector)
garbage_collector.AddTrash(src)
else
delayed_garbage |= src
/icon/finalize_qdel() /icon/finalize_qdel()
del(src) del(src)
@@ -126,7 +136,6 @@ var/list/delayed_garbage = list()
tag = null tag = null
return return
#define TESTING 1
#ifdef TESTING #ifdef TESTING
/client/var/running_find_references /client/var/running_find_references

View File

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

View File

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

View File

@@ -9,3 +9,6 @@
/datum/controller/process/nanoui/doWork() /datum/controller/process/nanoui/doWork()
updateQueueInstance.init(nanomanager.processing_uis, "process") updateQueueInstance.init(nanomanager.processing_uis, "process")
updateQueueInstance.Run() 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) if(updateQueueInstance)
updateQueueInstance.init(processing_objects, "process") updateQueueInstance.init(processing_objects, "process")
updateQueueInstance.Run() updateQueueInstance.Run()
/datum/controller/process/obj/getStatName()
return ..()+"([processing_objects.len])"

View File

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

View File

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

View File

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

View File

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

View File

@@ -22,6 +22,11 @@
new/mob/living/simple_animal/hostile/blobspore(src.loc, src) new/mob/living/simple_animal/hostile/blobspore(src.loc, src)
return 1 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 /mob/living/simple_animal/hostile/blobspore
name = "blob" name = "blob"
@@ -58,9 +63,10 @@
..(loc) ..(loc)
return return
death() death()
..()
if(factory)
factory.spores -= src
..()
qdel(src) qdel(src)
/mob/living/simple_animal/hostile/blobspore/Destroy()
if(factory)
factory.spores -= src
factory = null
..()

View File

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

View File

@@ -97,6 +97,10 @@
pass_flags = PASSTABLE | PASSGRILLE pass_flags = PASSTABLE | PASSGRILLE
power = 2 power = 2
/obj/effect/meteor/Destroy()
walk(src,0) //this cancels the walk_towards() proc
..()
/obj/effect/meteor/Bump(atom/A) /obj/effect/meteor/Bump(atom/A)
spawn(0) spawn(0)
@@ -157,4 +161,4 @@
if(istype(W, /obj/item/weapon/pickaxe)) if(istype(W, /obj/item/weapon/pickaxe))
qdel(src) qdel(src)
return return
..() ..()

View File

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

View File

@@ -98,6 +98,10 @@
TLV["temperature"] = list(20, 40, 140, 160) // K TLV["temperature"] = list(20, 40, 140, 160) // K
target_temperature = 90 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) /obj/machinery/alarm/New(var/loc, var/dir, var/building = 0)
..() ..()

View File

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

View File

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

View File

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

View File

@@ -58,6 +58,10 @@
if(radio_controller) if(radio_controller)
radio_controller.add_object(src, beacon_freq, filter = RADIO_NAVBEACONS) 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() /obj/machinery/bot/cleanbot/turn_on()
. = ..() . = ..()

View File

@@ -76,6 +76,12 @@
suffix = "#[count]" suffix = "#[count]"
name = "Mulebot ([suffix])" 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 // attack by item
// emag : lock/unlock, // emag : lock/unlock,
// screwdriver: open/close hatch // screwdriver: open/close hatch

View File

@@ -107,6 +107,11 @@
if((lasercolor == "r") && (name == created_name)) if((lasercolor == "r") && (name == created_name))
name = pick("RED RAMPAGE","RED ROVER","RED KILLDEATH MURDERBOT") 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() /obj/machinery/bot/secbot/update_icon()
if(on && is_attacking) if(on && is_attacking)

View File

@@ -53,6 +53,14 @@
ASSERT(src.network.len > 0) 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) /obj/machinery/camera/emp_act(severity)
if(!isEmpProof()) if(!isEmpProof())
if(prob(100/severity)) if(prob(100/severity))

View File

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

View File

@@ -25,8 +25,10 @@
initialize_directions = dir initialize_directions = dir
/obj/machinery/atmospherics/unary/cryo_cell/Destroy() /obj/machinery/atmospherics/unary/cryo_cell/Destroy()
if(occupant) var/turf/T = loc
occupant.loc = 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() /obj/machinery/atmospherics/unary/cryo_cell/initialize()

View File

@@ -30,7 +30,7 @@ obj/machinery/door/airlock/proc/execute_current_command()
if (!cur_command) if (!cur_command)
return return
do_command(cur_command) do_command(cur_command)
if (command_completed(cur_command)) if (command_completed(cur_command))
cur_command = null cur_command = null
@@ -63,7 +63,7 @@ obj/machinery/door/airlock/proc/do_command(var/command)
lock() lock()
sleep(2) sleep(2)
send_status() send_status()
obj/machinery/door/airlock/proc/command_completed(var/command) obj/machinery/door/airlock/proc/command_completed(var/command)
@@ -85,7 +85,7 @@ obj/machinery/door/airlock/proc/command_completed(var/command)
if("secure_close") if("secure_close")
return (locked && density) return (locked && density)
return 1 //Unknown command. Just assume it's completed. return 1 //Unknown command. Just assume it's completed.
obj/machinery/door/airlock/proc/send_status(var/bumped = 0) obj/machinery/door/airlock/proc/send_status(var/bumped = 0)
@@ -97,7 +97,7 @@ obj/machinery/door/airlock/proc/send_status(var/bumped = 0)
signal.data["door_status"] = density?("closed"):("open") signal.data["door_status"] = density?("closed"):("open")
signal.data["lock_status"] = locked?("locked"):("unlocked") signal.data["lock_status"] = locked?("locked"):("unlocked")
if (bumped) if (bumped)
signal.data["bumped_with_access"] = 1 signal.data["bumped_with_access"] = 1
@@ -142,8 +142,10 @@ obj/machinery/door/airlock/New()
if(radio_controller) if(radio_controller)
set_frequency(frequency) set_frequency(frequency)
obj/machinery/door/airlock/Destroy()
if(frequency && radio_controller)
radio_controller.remove_object(src,frequency)
..()
obj/machinery/airlock_sensor obj/machinery/airlock_sensor
icon = 'icons/obj/airlock_machines.dmi' icon = 'icons/obj/airlock_machines.dmi'
@@ -215,6 +217,10 @@ obj/machinery/airlock_sensor/New()
if(radio_controller) if(radio_controller)
set_frequency(frequency) set_frequency(frequency)
obj/machinery/airlock_sensor/Destroy()
if(radio_controller)
radio_controller.remove_object(src,frequency)
..()
obj/machinery/airlock_sensor/airlock_interior obj/machinery/airlock_sensor/airlock_interior
command = "cycle_interior" command = "cycle_interior"
@@ -283,6 +289,11 @@ obj/machinery/access_button/New()
if(radio_controller) if(radio_controller)
set_frequency(frequency) set_frequency(frequency)
obj/machinery/access_button/Destroy()
if(radio_controller)
radio_controller.remove_object(src, frequency)
..()
obj/machinery/access_button/airlock_interior obj/machinery/access_button/airlock_interior
frequency = 1379 frequency = 1379
command = "cycle_interior" command = "cycle_interior"

View File

@@ -13,6 +13,11 @@
..() ..()
air_connection = new 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() /obj/machinery/door/airlock/alarmlock/initialize()
..() ..()
radio_controller.remove_object(src, air_frequency) radio_controller.remove_object(src, air_frequency)

View File

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

View File

@@ -9,6 +9,11 @@
var/on = 1 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) /obj/machinery/embedded_controller/proc/post_signal(datum/signal/signal, comm_line)
return 0 return 0

View File

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

View File

@@ -190,8 +190,10 @@
pulling = 0 pulling = 0
/obj/machinery/magnetic_module/Destroy()
if(radio_controller)
radio_controller.remove_object(src, freq)
..()
/obj/machinery/magnetic_controller /obj/machinery/magnetic_controller
name = "Magnetic Control Console" name = "Magnetic Control Console"
@@ -399,25 +401,7 @@
// there doesn't HAVE to be separators but it makes paths syntatically visible // 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() 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 //req_console_departments += department
switch(departmentType) switch(departmentType)
if(1) if(1)
if(!("[department]" in req_console_assistance)) req_console_assistance |= department
req_console_assistance += department
if(2) if(2)
if(!("[department]" in req_console_supplies)) req_console_supplies |= department
req_console_supplies += department
if(3) if(3)
if(!("[department]" in req_console_information)) req_console_information |= department
req_console_information += department
if(4) if(4)
if(!("[department]" in req_console_assistance)) req_console_assistance |= department
req_console_assistance += department req_console_supplies |= department
if(!("[department]" in req_console_supplies))
req_console_supplies += department
if(5) if(5)
if(!("[department]" in req_console_assistance)) req_console_assistance |= department
req_console_assistance += department req_console_information |= department
if(!("[department]" in req_console_information))
req_console_information += department
if(6) if(6)
if(!("[department]" in req_console_supplies)) req_console_supplies |= department
req_console_supplies += department req_console_information |= department
if(!("[department]" in req_console_information))
req_console_information += department
if(7) if(7)
if(!("[department]" in req_console_assistance)) req_console_assistance |= department
req_console_assistance += department req_console_supplies |= department
if(!("[department]" in req_console_supplies)) req_console_information |= department
req_console_supplies += department
if(!("[department]" in req_console_information))
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) /obj/machinery/requests_console/attack_hand(user as mob)
if(..(user)) if(..(user))

View File

@@ -45,6 +45,11 @@
var/const/STATUS_DISPLAY_TIME = 4 var/const/STATUS_DISPLAY_TIME = 4
var/const/STATUS_DISPLAY_CUSTOM = 99 var/const/STATUS_DISPLAY_CUSTOM = 99
/obj/machinery/status_display/Destroy()
if(radio_controller)
radio_controller.remove_object(src,frequency)
..()
// register for radio system // register for radio system
/obj/machinery/status_display/initialize() /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) for(var/obj/machinery/telecomms/T in telecomms_list)
add_link(T) add_link(T)
/obj/machinery/telecomms/Destroy() /obj/machinery/telecomms/Destroy()
telecomms_list -= src telecomms_list -= src
for(var/obj/machinery/telecomms/comm in telecomms_list)
comm.links -= src
links = list()
..() ..()
// Used in auto linking // Used in auto linking

View File

@@ -146,9 +146,8 @@
/obj/machinery/vending/Destroy() /obj/machinery/vending/Destroy()
qdel(wires) qdel(wires)
wires = null wires = null
if(coin) qdel(coin)
qdel(coin) coin = null
coin = null
..() ..()
/obj/machinery/vending/ex_act(severity) /obj/machinery/vending/ex_act(severity)

View File

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

View File

@@ -24,7 +24,7 @@ var/global/list/image/splatter_cache=list()
/obj/effect/decal/cleanable/blood/Destroy() /obj/effect/decal/cleanable/blood/Destroy()
for(var/datum/disease/D in viruses) for(var/datum/disease/D in viruses)
D.cure(0) D.cure(0)
..() return ..()
/obj/effect/decal/cleanable/blood/New() /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() /obj/effect/Destroy()
if(reagents) if(reagents)
reagents.delete() reagents.delete()
PlaceInPool(src) return ..()
return 1
/obj/effect/effect/water/Move(turf/newloc) /obj/effect/effect/water/Move(turf/newloc)
//var/turf/T = src.loc //var/turf/T = src.loc
@@ -140,8 +139,7 @@ steam.start() -- spawns the effect
var/turf/T = src.loc var/turf/T = src.loc
if (istype(T, /turf)) if (istype(T, /turf))
T.hotspot_expose(1000,100) T.hotspot_expose(1000,100)
..() return ..()
return
/obj/effect/effect/sparks/Move() /obj/effect/effect/sparks/Move()
..() ..()

View File

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

View File

@@ -3,10 +3,6 @@
unacidable = 1 unacidable = 1
var/i_attached//Added for possible image attachments to objects. For hallucinations and the like. 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. /obj/effect/overlay/beam//Not actually a projectile, just an effect.
name="beam" name="beam"
icon='icons/effects/beam.dmi' icon='icons/effects/beam.dmi'

View File

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

View File

@@ -115,7 +115,9 @@
spawn(5) spawn(5)
radio = new /obj/item/radio/integrated/signal(src) radio = new /obj/item/radio/integrated/signal(src)
/obj/item/weapon/cartridge/signal/Destroy()
qdel(radio)
..()
/obj/item/weapon/cartridge/quartermaster /obj/item/weapon/cartridge/quartermaster
name = "\improper Space Parts & Space Vendors cartridge" 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", "summon", "active", active, "target", get_turf(PDA) , s_filter = RADIO_SECBOT)
post_signal(control_freq, "command", "bot_status", "active", active, 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 /obj/item/radio/integrated/mule
var/list/botlist = null // list of bots var/list/botlist = null // list of bots
var/obj/machinery/bot/mulebot/active // the active bot; if null, show bot list var/obj/machinery/bot/mulebot/active // the active bot; if null, show bot list
@@ -245,3 +251,8 @@
radio_connection.post_signal(src, signal) radio_connection.post_signal(src, signal)
return 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() /obj/item/device/radio/headset/Destroy()
qdel(keyslot1) qdel(keyslot1)
qdel(keyslot2) qdel(keyslot2)
keyslot1 = null
keyslot2 = null
..() ..()
/obj/item/device/radio/headset/examine(mob/user) /obj/item/device/radio/headset/examine(mob/user)

View File

@@ -45,6 +45,15 @@
if(radio_controller) if(radio_controller)
initialize() 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() /obj/item/device/radio/initialize()
@@ -625,7 +634,6 @@
onclose(user, "radio") onclose(user, "radio")
return return
/obj/item/device/radio/proc/config(op) /obj/item/device/radio/proc/config(op)
if(radio_controller) if(radio_controller)
for (var/ch_name in channels) for (var/ch_name in channels)

View File

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

View File

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

View File

@@ -40,6 +40,11 @@
spark_system.set_up(5, 0, src) spark_system.set_up(5, 0, src)
spark_system.attach(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) /obj/item/weapon/rcd/attackby(obj/item/weapon/W, mob/user)
if(istype(W, /obj/item/weapon/rcd_ammo)) if(istype(W, /obj/item/weapon/rcd_ammo))

View File

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

View File

@@ -9,6 +9,10 @@
name = master_item.name name = master_item.name
verbs -= /obj/item/verb/verb_pickup //make sure this is never picked up. 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() /obj/item/weapon/storage/internal/attack_hand()
return //make sure this is never picked up return //make sure this is never picked up

View File

@@ -11,6 +11,7 @@
w_class = 3 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/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/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_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/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. 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/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. 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) /obj/item/weapon/storage/MouseDrop(obj/over_object as obj)
if(!canremove) if(!canremove)
@@ -86,6 +93,7 @@
user.client.screen += src.closer user.client.screen += src.closer
user.client.screen += src.contents user.client.screen += src.contents
user.s_active = src user.s_active = src
is_seeing |= user
return return
/obj/item/weapon/storage/proc/hide_from(mob/user as mob) /obj/item/weapon/storage/proc/hide_from(mob/user as mob)
@@ -97,7 +105,7 @@
user.client.screen -= src.contents user.client.screen -= src.contents
if(user.s_active == src) if(user.s_active == src)
user.s_active = null user.s_active = null
return is_seeing -= user
/obj/item/weapon/storage/proc/open(mob/user as mob) /obj/item/weapon/storage/proc/open(mob/user as mob)
if (src.use_sound) if (src.use_sound)
@@ -109,11 +117,24 @@
show_to(user) show_to(user)
/obj/item/weapon/storage/proc/close(mob/user as mob) /obj/item/weapon/storage/proc/close(mob/user as mob)
src.hide_from(user) src.hide_from(user)
user.s_active = null user.s_active = null
return 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. //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. //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) /obj/item/weapon/storage/proc/orient_objs(tx, ty, mx, my)
@@ -463,4 +484,4 @@
return depth return depth
/obj/item/proc/get_storage_cost() /obj/item/proc/get_storage_cost()
return 2**(w_class-1) //1,2,4,8,16,... return 2**(w_class-1) //1,2,4,8,16,...

View File

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

View File

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

View File

@@ -102,7 +102,7 @@ var/list/mechtoys = list(
T.blocks_air = 1 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) var/turf/T = get_turf(loc)
if(T) if(T)
if(istype(T, /turf/simulated/floor)) if(istype(T, /turf/simulated/floor))

View File

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

View File

@@ -259,6 +259,9 @@
return return
/obj/effect/beam/i_beam/Destroy() /obj/effect/beam/i_beam/Destroy()
qdel(next) 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) proc/set_frequency(new_frequency)
if(!frequency)
return
if(!radio_controller) if(!radio_controller)
sleep(20) sleep(20)
if(!radio_controller) if(!radio_controller)
@@ -170,3 +172,9 @@
deadman = 1 deadman = 1
processing_objects.Add(src) processing_objects.Add(src)
usr.visible_message("\red [usr] moves their finger over [src]'s signal button...") 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_w_class = 2 //fit only pocket sized items
pockets.max_storage_space = 4 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) /obj/item/clothing/suit/storage/attack_hand(mob/user as mob)
if (pockets.handle_attack_hand(user)) if (pockets.handle_attack_hand(user))
..(user) ..(user)
@@ -59,7 +64,6 @@
pockets.max_w_class = 2 pockets.max_w_class = 2
pockets.max_storage_space = 8 pockets.max_storage_space = 8
/obj/item/clothing/suit/storage/vest /obj/item/clothing/suit/storage/vest
var/icon_badge var/icon_badge
var/icon_nobadge var/icon_nobadge

View File

@@ -3,7 +3,7 @@
// The datum containing all the chunks. // The datum containing all the chunks.
/datum/visualnet/camera /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/list/cameras = list()
var/cameras_unsorted = 1 var/cameras_unsorted = 1
chunk_type = /datum/chunk/camera chunk_type = /datum/chunk/camera

View File

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

View File

@@ -20,7 +20,7 @@
HOW IT WORKS HOW IT WORKS
It works by first creating a camera network datum. Inside of this camera network are "chunks" (which will be 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. 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 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() /obj/effect/Destroy()
updateVisibility(src) updateVisibility(src)
..() return ..()
/obj/effect/New() /obj/effect/New()
..() ..()

View File

@@ -115,6 +115,15 @@
locked = 1 locked = 1
return 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 /obj/item/device/mmi/radio_enabled
name = "radio-enabled man-machine interface" 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." 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 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(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. if(stat!=DEAD) //If not dead.
death(1) //Brains can die again. AND THEY SHOULD AHA HA HA HA HA HA 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) if(brainmob && brainmob.client)
brainmob.client.screen.len = null //clear the hud 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) /obj/item/organ/brain/proc/transfer_identity(var/mob/living/carbon/H)
name = "\the [H]'s [initial(src.name)]" name = "\the [H]'s [initial(src.name)]"
brainmob = new(src) 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 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++ 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) /mob/living/carbon/Move(NewLoc, direct)
. = ..() . = ..()
if(.) if(.)

View File

@@ -47,6 +47,11 @@
dna.real_name = real_name dna.real_name = real_name
make_blood() make_blood()
/mob/living/carbon/human/Destroy()
for(var/organ in organs)
qdel(organ)
return ..()
/mob/living/carbon/human/Stat() /mob/living/carbon/human/Stat()
..() ..()
statpanel("Status") statpanel("Status")
@@ -1358,4 +1363,4 @@
/mob/living/carbon/human/drop_from_inventory(var/obj/item/W, var/atom/Target = null) /mob/living/carbon/human/drop_from_inventory(var/obj/item/W, var/atom/Target = null)
if(W in organs) if(W in organs)
return return
..() ..()

View File

@@ -244,7 +244,7 @@ var/list/ai_verbs_default = list(
/obj/machinery/ai_powersupply/New(var/mob/living/silicon/ai/ai=null) /obj/machinery/ai_powersupply/New(var/mob/living/silicon/ai/ai=null)
powered_ai = ai powered_ai = ai
if(isnull(powered_ai)) if(isnull(powered_ai))
Del() qdel(src)
loc = powered_ai.loc loc = powered_ai.loc
use_power(1) // Just incase we need to wake up the power system. 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() /obj/machinery/ai_powersupply/process()
if(!powered_ai || powered_ai.stat & DEAD) if(!powered_ai || powered_ai.stat & DEAD)
Del() qdel(src)
if(!powered_ai.anchored) if(!powered_ai.anchored)
loc = powered_ai.loc loc = powered_ai.loc
use_power = 0 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 //If there's an MMI in the robot, have it ejected when the mob goes away. --NEO
//Improved /N //Improved /N
/mob/living/silicon/robot/Destroy() /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. var/turf/T = get_turf(loc)//To hopefully prevent run time errors.
if(T) mmi.loc = T 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 mmi = null
if(connected_ai)
connected_ai.connected_robots -= src
..() ..()
/mob/living/silicon/robot/proc/pick_module() /mob/living/silicon/robot/proc/pick_module()
@@ -662,7 +669,7 @@
C.r_arm = new/obj/item/robot_parts/r_arm(C) C.r_arm = new/obj/item/robot_parts/r_arm(C)
C.updateicon() C.updateicon()
new/obj/item/robot_parts/chest(loc) new/obj/item/robot_parts/chest(loc)
src.Del() qdel(src)
else else
// Okay we're not removing the cell or an MMI, but maybe something else? // Okay we're not removing the cell or an MMI, but maybe something else?
var/list/removable_components = list() var/list/removable_components = list()

View File

@@ -11,6 +11,17 @@
var/obj/item/emag = null var/obj/item/emag = null
var/obj/item/borg/upgrade/jetpack = 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) /obj/item/weapon/robot_module/emp_act(severity)
if(modules) if(modules)
for(var/obj/O in modules) for(var/obj/O in modules)

View File

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

View File

@@ -98,7 +98,7 @@
return 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) if(previous)
previous.Detach() previous.Detach()
..() ..()

View File

@@ -2,6 +2,11 @@
mob_list -= src mob_list -= src
dead_mob_list -= src dead_mob_list -= src
living_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() ghostize()
..() ..()
@@ -726,52 +731,11 @@ note dizziness decrements automatically in the mob's Life() proc.
statpanel("Status","CPU:","[world.cpu]") statpanel("Status","CPU:","[world.cpu]")
statpanel("Status","Instances:","[world.contents.len]") statpanel("Status","Instances:","[world.contents.len]")
if(statpanel("Status") && processScheduler && processScheduler.getIsRunning()) if(statpanel("Status") && processScheduler && processScheduler.getIsRunning())
var/datum/controller/process/process for(var/datum/controller/process/P in processScheduler.processes)
statpanel("Status",P.getStatName(), P.getTickTime())
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()]")
else else
statpanel("Status","processScheduler is not running.") statpanel("Status","processScheduler is not running.")
if(listed_turf && client) if(listed_turf && client)
if(!TurfAdjacent(listed_turf)) if(!TurfAdjacent(listed_turf))
listed_turf = null listed_turf = null

View File

@@ -37,7 +37,14 @@
/obj/item/weapon/grab/Destroy() /obj/item/weapon/grab/Destroy()
//make sure the grabbed_by list doesn't fill up with nulls //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. //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

@@ -31,7 +31,7 @@ field_generator power level display
var/list/obj/machinery/containment_field/fields var/list/obj/machinery/containment_field/fields
var/list/obj/machinery/field_generator/connected_gens var/list/obj/machinery/field_generator/connected_gens
var/clean_up = 0 var/clean_up = 0
//If keeping field generators powered is hard then increase the emitter active power usage. //If keeping field generators powered is hard then increase the emitter active power usage.
var/gen_power_draw = 5500 //power needed per generator var/gen_power_draw = 5500 //power needed per generator
var/field_power_draw = 2000 //power needed per field object var/field_power_draw = 2000 //power needed per field object
@@ -61,7 +61,6 @@ field_generator power level display
connected_gens = list() connected_gens = list()
return return
/obj/machinery/field_generator/process() /obj/machinery/field_generator/process()
if(Varedit_start == 1) if(Varedit_start == 1)
if(active == 0) if(active == 0)
@@ -231,22 +230,22 @@ field_generator power level display
//Tries to draw the needed power from our own power reserve, or connected generators if we can. Returns the amount of power we were able to get. //Tries to draw the needed power from our own power reserve, or connected generators if we can. Returns the amount of power we were able to get.
/obj/machinery/field_generator/proc/draw_power(var/draw = 0, var/list/flood_list = list()) /obj/machinery/field_generator/proc/draw_power(var/draw = 0, var/list/flood_list = list())
flood_list += src flood_list += src
if(src.power >= draw)//We have enough power if(src.power >= draw)//We have enough power
src.power -= draw src.power -= draw
return draw return draw
//Need more power //Need more power
var/actual_draw = src.power //already checked that power < draw var/actual_draw = src.power //already checked that power < draw
src.power = 0 src.power = 0
for(var/obj/machinery/field_generator/FG in connected_gens) for(var/obj/machinery/field_generator/FG in connected_gens)
if (FG in flood_list) if (FG in flood_list)
continue continue
actual_draw += FG.draw_power(draw - actual_draw, flood_list) //since the flood list reference is shared this actually works. actual_draw += FG.draw_power(draw - actual_draw, flood_list) //since the flood list reference is shared this actually works.
if (actual_draw >= draw) if (actual_draw >= draw)
return actual_draw return actual_draw
return actual_draw return actual_draw
/obj/machinery/field_generator/proc/start_fields() /obj/machinery/field_generator/proc/start_fields()

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/strength = null
var/desc_holder = null var/desc_holder = null
/obj/structure/particle_accelerator/Destroy()
construction_state = 0
if(master)
master.part_scan()
..()
/obj/structure/particle_accelerator/end_cap /obj/structure/particle_accelerator/end_cap
name = "Alpha Particle Generation Array" name = "Alpha Particle Generation Array"
desc_holder = "This is where Alpha particles are generated from \[REDACTED\]" 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) 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) /obj/machinery/particle_accelerator/control_box/attack_hand(mob/user as mob)
if(construction_state >= 3) if(construction_state >= 3)

View File

@@ -83,6 +83,12 @@
return return
/obj/machinery/power/smes/Destroy()
if(terminal)
disconnect_terminal()
..()
/obj/machinery/power/smes/update_icon() /obj/machinery/power/smes/update_icon()
overlays.Cut() overlays.Cut()
if(stat & BROKEN) return 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." user << "[src] shatters into a scattering of overstressed metal shards as it leaves the crossbow."
var/obj/item/weapon/shard/shrapnel/S = new() var/obj/item/weapon/shard/shrapnel/S = new()
S.loc = get_turf(src) S.loc = get_turf(src)
src.Del() qdel(src)
/obj/item/weapon/gun/launcher/crossbow /obj/item/weapon/gun/launcher/crossbow
name = "powered crossbow" name = "powered crossbow"

View File

@@ -649,6 +649,15 @@ datum
return trans_data 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. /* Must check the transfering of reagents and their data first. They all can point to one disease datum.
Del() Destroy()
if(src.data["virus"]) if(src.data["virus"])
var/datum/disease/D = src.data["virus"] var/datum/disease/D = src.data["virus"]
D.cure(0) D.cure(0)
@@ -1790,7 +1790,7 @@ datum
..() ..()
return return
Del() Destroy()
if(holder && ismob(holder.my_atom)) if(holder && ismob(holder.my_atom))
var/mob/M = holder.my_atom var/mob/M = holder.my_atom
M.status_flags &= ~FAKEDEATH M.status_flags &= ~FAKEDEATH
@@ -4428,5 +4428,9 @@ datum
..() ..()
return 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 // Undefine the alias for REAGENTS_EFFECT_MULTIPLER
#undef REM #undef REM

View File

@@ -43,6 +43,11 @@
air_contents.volume = PRESSURE_TANK_VOLUME air_contents.volume = PRESSURE_TANK_VOLUME
update() update()
/obj/machinery/disposal/Destroy()
eject()
if(trunk)
trunk.linked = null
..()
// attack by item places it in to disposal // attack by item places it in to disposal
/obj/machinery/disposal/attackby(var/obj/item/I, var/mob/user) /obj/machinery/disposal/attackby(var/obj/item/I, var/mob/user)
@@ -638,6 +643,11 @@
location.assume_air(gas) // vent all gas to turf location.assume_air(gas) // vent all gas to turf
return return
/obj/structure/disposalholder/Destroy()
qdel(gas)
active = 0
..()
// Disposal pipes // Disposal pipes
/obj/structure/disposalpipe /obj/structure/disposalpipe
@@ -663,7 +673,7 @@
// pipe is deleted // pipe is deleted
// ensure if holder is present, it is expelled // ensure if holder is present, it is expelled
Del() Destroy()
var/obj/structure/disposalholder/H = locate() in src var/obj/structure/disposalholder/H = locate() in src
if(H) if(H)
// holder was present // holder was present
@@ -920,6 +930,30 @@
qdel(src) 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 // *** TEST verb
//client/verb/dispstop() //client/verb/dispstop()
// for(var/obj/structure/disposalholder/H in world) // for(var/obj/structure/disposalholder/H in world)
@@ -1468,8 +1502,6 @@
user << "You need more welding fuel to complete this task." user << "You need more welding fuel to complete this task."
return return
// called when movable is expelled from a disposal pipe or outlet // called when movable is expelled from a disposal pipe or outlet
// by default does nothing, override for special behaviour // by default does nothing, override for special behaviour

View File

@@ -307,6 +307,16 @@
return 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 /obj/item/device/destTagger
name = "destination tagger" name = "destination tagger"
@@ -440,3 +450,8 @@
else else
user << "You need more welding fuel to complete this task." user << "You need more welding fuel to complete this task."
return return
/obj/machinery/disposal/deliveryChute/Destroy()
if(trunk)
trunk.linked = null
..()

View File

@@ -153,7 +153,6 @@
collapse_shields() collapse_shields()
..() ..()
/obj/machinery/shieldgen/proc/shields_up() /obj/machinery/shieldgen/proc/shields_up()
if(active) return 0 //If it's already turned on, how did this get called? if(active) return 0 //If it's already turned on, how did this get called?
@@ -161,7 +160,7 @@
update_icon() update_icon()
create_shields() create_shields()
idle_power_usage = 0 idle_power_usage = 0
for(var/obj/machinery/shield/shield_tile in deployed_shields) for(var/obj/machinery/shield/shield_tile in deployed_shields)
idle_power_usage += shield_tile.shield_idle_power idle_power_usage += shield_tile.shield_idle_power
@@ -174,7 +173,7 @@
update_icon() update_icon()
collapse_shields() collapse_shields()
update_use_power(0) update_use_power(0)
/obj/machinery/shieldgen/proc/create_shields() /obj/machinery/shieldgen/proc/create_shields()
@@ -201,22 +200,22 @@
/obj/machinery/shieldgen/process() /obj/machinery/shieldgen/process()
if (!active || (stat & NOPOWER)) if (!active || (stat & NOPOWER))
return return
if(malfunction) if(malfunction)
if(deployed_shields.len && prob(5)) if(deployed_shields.len && prob(5))
qdel(pick(deployed_shields)) qdel(pick(deployed_shields))
else else
if (check_delay <= 0) if (check_delay <= 0)
create_shields() create_shields()
var/new_power_usage = 0 var/new_power_usage = 0
for(var/obj/machinery/shield/shield_tile in deployed_shields) for(var/obj/machinery/shield/shield_tile in deployed_shields)
new_power_usage += shield_tile.shield_idle_power new_power_usage += shield_tile.shield_idle_power
if (new_power_usage != idle_power_usage) if (new_power_usage != idle_power_usage)
idle_power_usage = new_power_usage idle_power_usage = new_power_usage
use_power(0) use_power(0)
check_delay = 60 check_delay = 60
else else
check_delay-- check_delay--

View File

@@ -39,6 +39,12 @@
field = new/list() 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) /obj/machinery/shield_gen/attackby(obj/item/W, mob/user)
if(istype(W, /obj/item/weapon/card/id)) if(istype(W, /obj/item/weapon/card/id))
var/obj/item/weapon/card/id/C = W var/obj/item/weapon/card/id/C = W

View File

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