mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-20 12:35:33 +01:00
[MIRROR] Dunking handle_atom_del() in the trash bin. [MDB IGNORE] (#23183)
* Dunking handle_atom_del() in the trash bin. * Update _box_magazine.dm * Modular paths --------- Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com> Co-authored-by: Giz <13398309+vinylspiders@users.noreply.github.com>
This commit is contained in:
@@ -34,9 +34,9 @@
|
||||
// This really shouldn't happen. If it somehow does, print out a stack trace and gracefully handle it.
|
||||
stack_trace("apply_defauly_parts called on machine that already had component_parts: [machine]")
|
||||
|
||||
// Move to nullspace so you don't trigger handle_atom_del logic and remove existing parts.
|
||||
// Remove references of components so it doesn't trigger Exited logic and remove existing parts.
|
||||
for(var/obj/item/part as anything in machine.component_parts)
|
||||
part.moveToNullspace(loc)
|
||||
machine.component_parts -= part
|
||||
qdel(part)
|
||||
|
||||
// List of components always contains the circuit board used to build it.
|
||||
@@ -47,9 +47,7 @@
|
||||
// This really shouldn't happen. If it somehow does, print out a stack trace and gracefully handle it.
|
||||
stack_trace("apply_default_parts called from a circuit board that does not belong to machine: [machine]")
|
||||
|
||||
// Move to nullspace so you don't trigger handle_atom_del logic, remove old circuit, add new circuit.
|
||||
machine.circuit.moveToNullspace()
|
||||
qdel(machine.circuit)
|
||||
QDEL_NULL(machine.circuit)
|
||||
machine.circuit = src
|
||||
|
||||
return
|
||||
|
||||
@@ -33,16 +33,14 @@
|
||||
/obj/item/transfer_valve/IsAssemblyHolder()
|
||||
return TRUE
|
||||
|
||||
/obj/item/transfer_valve/handle_atom_del(atom/deleted_atom)
|
||||
/obj/item/transfer_valve/Exited(atom/movable/gone, direction)
|
||||
. = ..()
|
||||
if(deleted_atom == tank_one)
|
||||
if(gone == tank_one)
|
||||
tank_one = null
|
||||
update_appearance()
|
||||
return
|
||||
if(deleted_atom == tank_two)
|
||||
else if(gone == tank_two)
|
||||
tank_two = null
|
||||
update_appearance()
|
||||
return
|
||||
|
||||
/obj/item/transfer_valve/attackby(obj/item/item, mob/user, params)
|
||||
if(istype(item, /obj/item/tank))
|
||||
@@ -152,7 +150,7 @@
|
||||
T.Translate(-13, 0)
|
||||
J.transform = T
|
||||
underlays = list(J)
|
||||
|
||||
|
||||
if(wired)
|
||||
cable_overlay = mutable_appearance(icon, icon_state = "valve_cables", layer = layer + 0.05, appearance_flags = KEEP_TOGETHER)
|
||||
add_overlay(cable_overlay)
|
||||
@@ -160,12 +158,12 @@
|
||||
else if(cable_overlay)
|
||||
cut_overlay(cable_overlay, TRUE)
|
||||
cable_overlay = null
|
||||
|
||||
|
||||
worn_icon_state = "[initial(worn_icon_state)][tank_two ? "l" : ""][tank_one ? "r" : ""]"
|
||||
if(ishuman(loc)) //worn
|
||||
var/mob/living/carbon/human/human = loc
|
||||
human.update_worn_back()
|
||||
|
||||
|
||||
if(!attached_device)
|
||||
return
|
||||
|
||||
@@ -303,14 +301,12 @@
|
||||
split_gases()
|
||||
valve_open = FALSE
|
||||
tank_one.forceMove(drop_location())
|
||||
tank_one = null
|
||||
. = TRUE
|
||||
if("tanktwo")
|
||||
if(tank_two)
|
||||
split_gases()
|
||||
valve_open = FALSE
|
||||
tank_two.forceMove(drop_location())
|
||||
tank_two = null
|
||||
. = TRUE
|
||||
if("toggle")
|
||||
toggle_valve()
|
||||
|
||||
@@ -25,12 +25,12 @@
|
||||
if(case)
|
||||
. += span_warning("There seems to be something inside it, but you can't quite tell what from here...")
|
||||
|
||||
/obj/item/implantpad/handle_atom_del(atom/A)
|
||||
if(A == case)
|
||||
case = null
|
||||
update_appearance()
|
||||
updateSelfDialog()
|
||||
/obj/item/implantpad/Exited(atom/movable/gone, direction)
|
||||
. = ..()
|
||||
if(gone == case)
|
||||
case = null
|
||||
update_appearance()
|
||||
updateSelfDialog()
|
||||
|
||||
/obj/item/implantpad/AltClick(mob/user)
|
||||
..()
|
||||
@@ -44,7 +44,6 @@
|
||||
|
||||
add_fingerprint(user)
|
||||
case.add_fingerprint(user)
|
||||
case = null
|
||||
|
||||
updateSelfDialog()
|
||||
update_appearance()
|
||||
|
||||
@@ -37,16 +37,10 @@
|
||||
cell = new cell(src)
|
||||
|
||||
// Clean up the cell on destroy
|
||||
/obj/item/clothing/suit/space/Destroy()
|
||||
if(isatom(cell))
|
||||
QDEL_NULL(cell)
|
||||
return ..()
|
||||
|
||||
// Clean up the cell on destroy
|
||||
/obj/item/inspector/handle_atom_del(atom/A)
|
||||
if(A == cell)
|
||||
/obj/item/inspector/Exited(atom/movable/gone, direction)
|
||||
. = ..()
|
||||
if(gone == cell)
|
||||
cell = null
|
||||
return ..()
|
||||
|
||||
// support for items that interact with the cell
|
||||
/obj/item/inspector/get_cell()
|
||||
|
||||
@@ -416,16 +416,15 @@
|
||||
..()
|
||||
if (held_sausage)
|
||||
user.put_in_hands(held_sausage)
|
||||
held_sausage = null
|
||||
update_appearance()
|
||||
|
||||
/obj/item/melee/roastingstick/update_overlays()
|
||||
. = ..()
|
||||
if(held_sausage)
|
||||
. += mutable_appearance(icon, "roastingstick_sausage")
|
||||
|
||||
/obj/item/melee/roastingstick/handle_atom_del(atom/target)
|
||||
if (target == held_sausage)
|
||||
/obj/item/melee/roastingstick/Exited(atom/movable/gone, direction)
|
||||
. = ..()
|
||||
if (gone == held_sausage)
|
||||
held_sausage = null
|
||||
update_appearance()
|
||||
|
||||
|
||||
@@ -32,17 +32,11 @@
|
||||
return ..()
|
||||
|
||||
/obj/item/pet_carrier/Exited(atom/movable/gone, direction)
|
||||
. = ..()
|
||||
if(isliving(gone) && (gone in occupants))
|
||||
var/mob/living/L = gone
|
||||
var/mob/living/living_gone = gone
|
||||
occupants -= gone
|
||||
occupant_weight -= L.mob_size
|
||||
|
||||
/obj/item/pet_carrier/handle_atom_del(atom/A)
|
||||
if(A in occupants && isliving(A))
|
||||
var/mob/living/L = A
|
||||
occupants -= L
|
||||
occupant_weight -= L.mob_size
|
||||
..()
|
||||
occupant_weight -= living_gone.mob_size
|
||||
|
||||
/obj/item/pet_carrier/examine(mob/user)
|
||||
. = ..()
|
||||
|
||||
@@ -108,10 +108,10 @@
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/item/toy/plush/handle_atom_del(atom/A)
|
||||
if(A == grenade)
|
||||
/obj/item/toy/plush/Exited(atom/movable/gone, direction)
|
||||
. = ..()
|
||||
if(gone == grenade)
|
||||
grenade = null
|
||||
..()
|
||||
|
||||
/obj/item/toy/plush/attack_self(mob/user)
|
||||
. = ..()
|
||||
@@ -148,7 +148,6 @@
|
||||
else
|
||||
to_chat(user, span_notice("You remove the grenade from [src]."))
|
||||
user.put_in_hands(grenade)
|
||||
grenade = null
|
||||
return
|
||||
if(isgrenade(I))
|
||||
if(stuffed)
|
||||
|
||||
@@ -250,15 +250,15 @@
|
||||
var/turf/newtarget = locate(new_x, new_y, starting.z)
|
||||
return newtarget
|
||||
|
||||
/obj/item/pneumatic_cannon/handle_atom_del(atom/A)
|
||||
/obj/item/pneumatic_cannon/Exited(atom/movable/gone, direction)
|
||||
. = ..()
|
||||
if (loadedItems.Remove(A))
|
||||
var/obj/item/I = A
|
||||
if(istype(I))
|
||||
loadedWeightClass -= I.w_class
|
||||
if(loadedItems.Remove(gone))
|
||||
var/obj/item/item = gone
|
||||
if(istype(item))
|
||||
loadedWeightClass -= item.w_class
|
||||
else
|
||||
loadedWeightClass--
|
||||
else if (A == tank)
|
||||
else if (gone == tank)
|
||||
tank = null
|
||||
update_appearance()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user