Fixes up a few Destroys

This commit is contained in:
Fox-McCloud
2015-09-18 04:20:02 -04:00
parent 6a79ff83a1
commit 74565c101b
16 changed files with 127 additions and 21 deletions
+4
View File
@@ -46,6 +46,10 @@ var/list/wireColours = list("red", "blue", "green", "black", "orange", "brown",
var/list/wires = same_wires[holder_type]
src.wires = wires // Reference the wires list.
/datum/wires/Destroy()
holder = null
return ..()
/datum/wires/proc/GenerateWires()
var/list/colours_to_pick = wireColours.Copy() // Get a copy, not a reference.
var/list/indexes_to_pick = list()
+2
View File
@@ -209,6 +209,8 @@
if(radio_controller)
radio_controller.remove_object(src, frequency)
air_alarm_repository.update_cache(src)
qdel(wires)
wires = null
return ..()
/obj/machinery/alarm/proc/first_run()
+7
View File
@@ -73,6 +73,13 @@
component_parts += new /obj/item/weapon/stock_parts/console_screen(null)
RefreshParts()
/obj/machinery/autolathe/Destroy()
qdel(wires)
wires = null
qdel(materials)
materials = null
return ..()
/obj/machinery/autolathe/interact(mob/user)
if(shocked && !(stat & NOPOWER))
shock(user,50)
+5 -1
View File
@@ -78,7 +78,11 @@ var/global/mulebot_count = 0
suffix = "#[mulebot_count]"
name = "\improper Mulebot ([suffix])"
/obj/machinery/bot/mulebot/Destroy()
unload(0)
qdel(wires)
wires = null
return ..()
// attack by item
// emag : lock/unlock,
+5 -1
View File
@@ -318,7 +318,6 @@
return
/*
About the new airlock wires panel:
* An airlock wire dialog can be accessed by the normal way or by using wirecutters or a multitool on the door while the wire-panel is open. This would show the following wires, which you can either wirecut/mend or send a multitool pulse through. There are 9 wires.
@@ -335,6 +334,11 @@ About the new airlock wires panel:
// You can find code for the airlock wires in the wire datum folder.
/obj/machinery/door/airlock/Destroy()
qdel(wires)
wires = null
return ..()
/obj/machinery/door/airlock/bumpopen(mob/living/user as mob) //Airlocks now zap you when you 'bump' them open when they're electrified. --NeoFite
if(!issilicon(usr))
if(src.isElectrified())
+4
View File
@@ -40,6 +40,10 @@
update_icon()
..()
/obj/machinery/syndicatebomb/Destroy()
qdel(wires)
wires = null
return ..()
/obj/machinery/syndicatebomb/examine(mob/user)
..(user)
@@ -25,7 +25,16 @@
if(ks2type)
keyslot2 = new ks2type(src)
recalculateChannels(1)
/obj/item/device/radio/headset/Destroy()
if(keyslot1)
qdel(keyslot1)
if(keyslot2)
qdel(keyslot2)
keyslot1 = null
keyslot2 = null
return ..()
/obj/item/device/radio/headset/list_channels(var/mob/user)
return list_secure_channels()
@@ -326,7 +335,7 @@
user.drop_item()
W.loc = src
keyslot2 = W
recalculateChannels()
return
@@ -69,6 +69,17 @@ var/global/list/default_medbay_channels = list(
internal_channels = default_internal_channels.Copy()
/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])
patch_link = null
return ..()
/obj/item/device/radio/initialize()
if(frequency < RADIO_LOW_FREQ || frequency > RADIO_HIGH_FREQ)
frequency = sanitize_frequency(frequency, RADIO_LOW_FREQ, RADIO_HIGH_FREQ)
@@ -17,6 +17,12 @@
wires = new(src)
..()
/obj/item/weapon/c4/Destroy()
qdel(wires)
wires = null
target = null
return ..()
/obj/item/weapon/c4/suicide_act(var/mob/user)
. = (BRUTELOSS)
viewers(user) << "<span class='suicide'>[user] activates the C4 and holds it above his head! It looks like \he's going out with a bang!</span>"
+5
View File
@@ -127,6 +127,11 @@
var/attacher = "UNKNOWN"
var/datum/wires/explosive/gibtonite/wires
/obj/item/weapon/twohanded/required/gibtonite/Destroy()
qdel(wires)
wires = null
return ..()
/obj/item/weapon/twohanded/required/gibtonite/attackby(obj/item/I, mob/user, params)
if(!wires && istype(I, /obj/item/device/assembly/igniter))
user.visible_message("[user] attaches [I] to [src].", "<span class='notice'>You attach [I] to [src].</span>")
@@ -202,6 +202,8 @@ var/list/robot_verbs_default = list(
mmi = null
if(connected_ai)
connected_ai.connected_robots -= src
qdel(wires)
wires = null
return ..()
/mob/living/silicon/robot/proc/pick_module()
+16 -4
View File
@@ -424,17 +424,29 @@
return EAT_TIME_FAT //if it doesn't fit into the above, it's probably a fat guy, take EAT_TIME_FAT to do it
/obj/item/weapon/grab/dropped()
qdel(src)
loc = null
if(!destroying)
qdel(src)
/obj/item/weapon/grab
var/destroying = 0
/obj/item/weapon/grab/Destroy()
animate(affecting, pixel_x = 0, pixel_y = 0, 4, 1, LINEAR_EASING)
affecting.layer = 4
if(affecting)
affecting.pixel_x = 0
affecting.pixel_y = 0 //used to be an animate, not quick enough for del'ing
affecting.layer = initial(affecting.layer)
affecting.grabbed_by -= src
affecting = null
if(assailant)
if(assailant.client)
assailant.client.screen -= hud
assailant = null
qdel(hud)
hud = null
destroying = 1 // stops us calling qdel(src) on dropped()
return ..()
#undef EAT_TIME_XENO
#undef EAT_TIME_FAT
+20
View File
@@ -22,6 +22,26 @@ var/list/organ_cache = list()
// links chemical IDs to number of ticks for which they'll stay in the blood
germ_level = 0
/obj/item/organ/Destroy()
if(!owner)
return ..()
if(istype(owner, /mob/living/carbon))
if((owner.internal_organs) && (src in owner.internal_organs))
owner.internal_organs -= src
if(istype(owner, /mob/living/carbon/human))
if((owner.internal_organs_by_name) && (src in owner.internal_organs_by_name))
owner.internal_organs_by_name -= src
if((owner.organs) && (src in owner.organs))
owner.organs -= src
if((owner.organs_by_name) && (src in owner.organs_by_name))
owner.organs_by_name -= src
if(src in owner.contents)
owner.contents -= src
return ..()
/obj/item/organ/attack_self(mob/user as mob)
// Convert it to an edible form, yum yum.
+23 -10
View File
@@ -7,10 +7,10 @@
max_damage = 0
dir = SOUTH
organ_tag = "limb"
var/brute_mod = 1
var/burn_mod = 1
var/icon_name = null
var/body_part = null
var/icon_position = 0
@@ -61,6 +61,19 @@
var/can_grasp
var/can_stand
/obj/item/organ/external/Destroy()
if(parent && parent.children)
parent.children -= src
if(children)
for(var/obj/item/organ/external/C in children)
qdel(C)
if(internal_organs)
for(var/obj/item/organ/O in internal_organs)
qdel(O)
return ..()
/obj/item/organ/external/attackby(obj/item/weapon/W as obj, mob/user as mob)
switch(stage)
@@ -120,7 +133,7 @@
if(!parent.children)
parent.children = list()
parent.children.Add(src)
/obj/item/organ/external/robotize()
..()
//robot limbs take reduced damage
@@ -137,7 +150,7 @@
if(status & ORGAN_DESTROYED)
return 0
brute *= brute_mod
burn *= burn_mod
@@ -311,7 +324,7 @@ This function completely restores a damaged organ to perfect condition.
"<span class='alert'>The wound on your [name] widens with a nasty ripping noise.</span>",\
"You hear a nasty ripping noise, as if flesh is being torn apart.")
return
//Creating wound
var/wound_type = get_wound_type(type, damage)
@@ -536,8 +549,8 @@ Note that amputating the affected organ does in fact remove the infection from t
var/mob/living/carbon/human/H
if(istype(owner,/mob/living/carbon/human))
H = owner
H = owner
for(var/datum/wound/W in wounds)
if(W.damage_type == CUT || W.damage_type == BRUISE)
brute_dam += W.damage
@@ -554,7 +567,7 @@ Note that amputating the affected organ does in fact remove the infection from t
if (open && !clamped && (H && !(H.species.flags & NO_BLOOD)))
status |= ORGAN_BLEEDING
//Bone fractures
if(config.bones_can_break && brute_dam > min_broken_damage * config.organ_health_multiplier && !(status & ORGAN_ROBOT))
src.fracture()
@@ -723,7 +736,7 @@ Note that amputating the affected organ does in fact remove the infection from t
/obj/item/organ/external/proc/fracture()
if(status & ORGAN_ROBOT)
return //ORGAN_BROKEN doesn't have the same meaning for robot limbs
if((status & ORGAN_BROKEN) || cannot_break)
return
if(owner)
@@ -787,7 +800,7 @@ Note that amputating the affected organ does in fact remove the infection from t
/obj/item/organ/external/proc/is_usable()
if((status & ORGAN_ROBOT) && get_damage() >= max_damage) //robot limbs just become inoperable at max damage
return
return
return !(status & (ORGAN_DESTROYED|ORGAN_MUTATED|ORGAN_DEAD))
/obj/item/organ/external/proc/is_malfunctioning()
+1
View File
@@ -157,6 +157,7 @@
if(occupier)
malfvacate(1)
qdel(wires)
wires = null
if(cell)
qdel(cell) // qdel
if(terminal)
@@ -29,8 +29,10 @@
/obj/machinery/particle_accelerator/control_box/Destroy()
if(active)
toggle_power()
qdel(wires)
wires = null
return ..()
/obj/machinery/particle_accelerator/control_box/attack_ghost(user as mob)
return src.attack_hand(user)
@@ -126,7 +128,7 @@
log_game("PA Control Computer increased to [strength] by [key_name(usr)] in ([x],[y],[z])")
investigate_log("increased to <font color='red'>[strength]</font> by [key_name(usr)]","singulo")
use_log += text("\[[time_stamp()]\] <font color='red'>[usr.name] ([key_name(usr)]) has increased the PA Control Computer to [strength].</font>")
investigate_log("increased to <font color='red'>[strength]</font> by [usr.key]","singulo")
strength_change()
@@ -139,7 +141,7 @@
message_admins("PA Control Computer decreased to [strength] by [key_name_admin(usr)] in ([x],[y],[z] - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>JMP</a>)",0,1)
log_game("PA Control Computer decreased to [strength] by [key_name(usr)] in ([x],[y],[z])")
investigate_log("decreased to <font color='green'>[strength]</font> by [key_name(usr)]","singulo")
use_log += text("\[[time_stamp()]\] <font color='orange'>[usr.name] ([key_name(usr)]) has decreased the PA Control Computer to [strength].</font>")
use_log += text("\[[time_stamp()]\] <font color='orange'>[usr.name] ([key_name(usr)]) has decreased the PA Control Computer to [strength].</font>")
strength_change()