mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-18 18:44:48 +01:00
Merge pull request #6961 from Fox-McCloud/garbage-collect-stuffs
Garbage Collection and Code Cleanup
This commit is contained in:
@@ -19,6 +19,11 @@
|
||||
burntime = 15
|
||||
var/obj/item/weapon/canvas/painting = null
|
||||
|
||||
/obj/structure/easel/Destroy()
|
||||
if(painting)
|
||||
qdel(painting)
|
||||
painting = null
|
||||
return ..()
|
||||
|
||||
//Adding canvases
|
||||
/obj/structure/easel/attackby(var/obj/item/I, var/mob/user, params)
|
||||
|
||||
@@ -22,6 +22,15 @@ var/global/list/captain_display_cases = list()
|
||||
var/obj/item/device/assembly/prox_sensor/sensor = null
|
||||
var/state = DISPLAYCASE_FRAME_CIRCUIT
|
||||
|
||||
/obj/structure/displaycase_frame/Destroy()
|
||||
if(circuit)
|
||||
qdel(circuit)
|
||||
circuit = null
|
||||
if(sensor)
|
||||
qdel(sensor)
|
||||
sensor = null
|
||||
return ..()
|
||||
|
||||
/obj/structure/displaycase_frame/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
|
||||
var/pstate = state
|
||||
var/turf/T = get_turf(src)
|
||||
|
||||
@@ -17,6 +17,12 @@
|
||||
/obj/structure/door_assembly/New()
|
||||
update_state()
|
||||
|
||||
/obj/structure/door_assembly/Destroy()
|
||||
if(electronics)
|
||||
qdel(electronics)
|
||||
electronics = null
|
||||
return ..()
|
||||
|
||||
/obj/structure/door_assembly/door_assembly_com
|
||||
base_icon_state = "com"
|
||||
base_name = "Command Airlock"
|
||||
|
||||
@@ -14,6 +14,33 @@
|
||||
var/obj/item/weapon/storage/toolbox/emergency/myredtoolbox = null
|
||||
var/obj/item/taperoll/engineering/myengitape = null
|
||||
|
||||
/obj/structure/engineeringcart/Destroy()
|
||||
if(myglass)
|
||||
qdel(myglass)
|
||||
myglass = null
|
||||
if(mymetal)
|
||||
qdel(mymetal)
|
||||
mymetal = null
|
||||
if(myplasteel)
|
||||
qdel(myplasteel)
|
||||
myplasteel = null
|
||||
if(myflashlight)
|
||||
qdel(myflashlight)
|
||||
myflashlight = null
|
||||
if(mybluetoolbox)
|
||||
qdel(mybluetoolbox)
|
||||
mybluetoolbox = null
|
||||
if(myyellowtoolbox)
|
||||
qdel(myyellowtoolbox)
|
||||
myyellowtoolbox = null
|
||||
if(myredtoolbox)
|
||||
qdel(myredtoolbox)
|
||||
myredtoolbox = null
|
||||
if(myengitape)
|
||||
qdel(myengitape)
|
||||
myengitape = null
|
||||
return ..()
|
||||
|
||||
/obj/structure/engineeringcart/proc/put_in_cart(obj/item/I, mob/user)
|
||||
user.drop_item()
|
||||
I.loc = src
|
||||
|
||||
@@ -8,6 +8,11 @@
|
||||
var/obj/item/weapon/extinguisher/has_extinguisher = new/obj/item/weapon/extinguisher
|
||||
var/opened = 0
|
||||
|
||||
/obj/structure/extinguisher_cabinet/Destroy()
|
||||
if(has_extinguisher)
|
||||
qdel(has_extinguisher)
|
||||
has_extinguisher = null
|
||||
return ..()
|
||||
|
||||
/obj/structure/extinguisher_cabinet/attackby(obj/item/O, mob/user, params)
|
||||
if(isrobot(user) || isalien(user))
|
||||
|
||||
@@ -19,12 +19,24 @@
|
||||
|
||||
|
||||
/obj/structure/janitorialcart/New()
|
||||
..()
|
||||
create_reagents(100)
|
||||
janitorial_equipment += src
|
||||
|
||||
|
||||
/obj/structure/janitorialcart/Destroy()
|
||||
janitorial_equipment -= src
|
||||
if(mybag)
|
||||
qdel(mybag)
|
||||
mybag = null
|
||||
if(mymop)
|
||||
qdel(mymop)
|
||||
mymop = null
|
||||
if(myspray)
|
||||
qdel(myspray)
|
||||
myspray = null
|
||||
if(myreplacer)
|
||||
qdel(myreplacer)
|
||||
myreplacer = null
|
||||
return ..()
|
||||
|
||||
/obj/structure/janitorialcart/proc/wet_mop(obj/item/weapon/mop, mob/user)
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
var/amount_per_transfer_from_this = 5 //shit I dunno, adding this so syringes stop runtime erroring. --NeoFite
|
||||
|
||||
/obj/structure/mopbucket/New()
|
||||
..()
|
||||
create_reagents(100)
|
||||
janitorial_equipment += src
|
||||
|
||||
|
||||
@@ -8,45 +8,50 @@
|
||||
flags = CONDUCT
|
||||
var/obj/item/target/pinned_target // the current pinned target
|
||||
|
||||
Move()
|
||||
..()
|
||||
// Move the pinned target along with the stake
|
||||
if(pinned_target in view(3, src))
|
||||
pinned_target.loc = loc
|
||||
/obj/structure/target_stake/Destroy()
|
||||
if(pinned_target)
|
||||
qdel(pinned_target)
|
||||
pinned_target = null
|
||||
return ..()
|
||||
|
||||
else // Sanity check: if the pinned target can't be found in immediate view
|
||||
pinned_target = null
|
||||
density = 1
|
||||
/obj/structure/target_stake/Move()
|
||||
..()
|
||||
// Move the pinned target along with the stake
|
||||
if(pinned_target in view(3, src))
|
||||
pinned_target.loc = loc
|
||||
|
||||
attackby(obj/item/W as obj, mob/user as mob, params)
|
||||
// Putting objects on the stake. Most importantly, targets
|
||||
if(pinned_target)
|
||||
return // get rid of that pinned target first!
|
||||
else // Sanity check: if the pinned target can't be found in immediate view
|
||||
pinned_target = null
|
||||
density = 1
|
||||
|
||||
if(istype(W, /obj/item/target))
|
||||
density = 0
|
||||
W.density = 1
|
||||
user.drop_item(src)
|
||||
W.loc = loc
|
||||
W.layer = 3.1
|
||||
pinned_target = W
|
||||
to_chat(user, "You slide the target into the stake.")
|
||||
return
|
||||
/obj/structure/target_stake/attackby(obj/item/W, mob/user, params)
|
||||
// Putting objects on the stake. Most importantly, targets
|
||||
if(pinned_target)
|
||||
return // get rid of that pinned target first!
|
||||
|
||||
attack_hand(mob/user as mob)
|
||||
// taking pinned targets off!
|
||||
if(pinned_target)
|
||||
density = 1
|
||||
pinned_target.density = 0
|
||||
pinned_target.layer = OBJ_LAYER
|
||||
if(istype(W, /obj/item/target))
|
||||
density = 0
|
||||
W.density = 1
|
||||
user.drop_item(src)
|
||||
W.loc = loc
|
||||
W.layer = 3.1
|
||||
pinned_target = W
|
||||
to_chat(user, "You slide the target into the stake.")
|
||||
|
||||
pinned_target.loc = user.loc
|
||||
if(ishuman(user))
|
||||
if(!user.get_active_hand())
|
||||
user.put_in_hands(pinned_target)
|
||||
to_chat(user, "You take the target out of the stake.")
|
||||
else
|
||||
pinned_target.loc = get_turf(user)
|
||||
/obj/structure/target_stake/attack_hand(mob/user)
|
||||
// taking pinned targets off!
|
||||
if(pinned_target)
|
||||
density = 1
|
||||
pinned_target.density = 0
|
||||
pinned_target.layer = OBJ_LAYER
|
||||
|
||||
pinned_target.loc = user.loc
|
||||
if(ishuman(user))
|
||||
if(!user.get_active_hand())
|
||||
user.put_in_hands(pinned_target)
|
||||
to_chat(user, "You take the target out of the stake.")
|
||||
else
|
||||
pinned_target.loc = get_turf(user)
|
||||
to_chat(user, "You take the target out of the stake.")
|
||||
|
||||
pinned_target = null
|
||||
pinned_target = null
|
||||
@@ -14,9 +14,13 @@
|
||||
|
||||
|
||||
/obj/structure/toilet/New()
|
||||
..()
|
||||
open = round(rand(0, 1))
|
||||
update_icon()
|
||||
|
||||
/obj/structure/toilet/Destroy()
|
||||
swirlie = null
|
||||
return ..()
|
||||
|
||||
/obj/structure/toilet/attack_hand(mob/living/user)
|
||||
if(swirlie)
|
||||
|
||||
@@ -34,6 +34,9 @@ obj/structure/windoor_assembly/New(dir=NORTH)
|
||||
|
||||
obj/structure/windoor_assembly/Destroy()
|
||||
density = 0
|
||||
if(electronics)
|
||||
qdel(electronics)
|
||||
electronics = null
|
||||
air_update_turf(1)
|
||||
return ..()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user