Refactors how machines are deconstructed (#81291)

## About The Pull Request
This refactors how machines are deconstructed in the following ways

- You can no longer override `obj/machinery/deconstruct()`. If you want
customized behaviour then override `on_deconstruction()` instead.

This comes with the added benifit of no longer needing to check for the
`NO_DECONSTRUCTION` flag because the machine base proc does that for us
& if it finds that flag it won't proceed to call `on_deconstruction()`
meaning no machine will have a chance to spawn anything which is the
current behaviour.

This is required to make #81290 work for all machines at least so that
machine can send the `COMSIG_OBJ_DECONSTRUCT` signal without subtypes
overriding & forgetting to call the parent proc

- `dump_contents()` only gets called when the machine is deconstructed
not destroyed thus not leaving behind any of its contents inside. Fixes
https://github.com/tgstation/tgstation/pull/81290#issuecomment-1925752583

## Changelog
🆑
fix: machines that should not drop contents when deleted no longer do.
refactor: refactors how machines are deconstructed. report bugs on
github.
/🆑

---------

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
This commit is contained in:
SyncIt21
2024-02-11 14:52:19 +01:00
committed by GitHub
co-authored by MrMelbert
parent 83c4412340
commit 4495ea2e4d
77 changed files with 255 additions and 350 deletions
+1 -1
View File
@@ -67,7 +67,7 @@
QDEL_NULL(stored_id_card)
return ..()
/obj/machinery/pdapainter/on_deconstruction()
/obj/machinery/pdapainter/on_deconstruction(disassembled)
// Don't use ejection procs as we're gonna be destroyed anyway, so no need to update icons or anything.
if(stored_pda)
stored_pda.forceMove(loc)
+19 -6
View File
@@ -198,9 +198,8 @@
end_processing()
clear_components()
dump_contents()
unset_static_power()
return ..()
/**
@@ -818,11 +817,15 @@
deconstruct(TRUE)
/obj/machinery/deconstruct(disassembled = TRUE)
SHOULD_NOT_OVERRIDE(TRUE)
if(obj_flags & NO_DECONSTRUCTION)
dump_contents() //drop everything inside us
return ..() //Just delete us, no need to call anything else.
on_deconstruction()
on_deconstruction(disassembled)
if(!LAZYLEN(component_parts))
dump_contents() //drop everything inside us
return ..() //we don't have any parts.
spawn_frame(disassembled)
@@ -841,8 +844,12 @@
continue
var/obj/item/stack/stack_path = component
new stack_path(loc, board.req_components[component])
LAZYCLEARLIST(component_parts)
//drop everything inside us. we do this last to give machines a chance
//to handle their contents before we dump them
dump_contents()
return ..()
/**
@@ -1128,8 +1135,14 @@
/obj/machinery/proc/on_construction(mob/user)
return
//called on deconstruction before the final deletion
/obj/machinery/proc/on_deconstruction()
/**
* called on deconstruction before the final deletion
* Arguments
*
* * disassembled - if TRUE means we used tools to deconstruct it, FALSE means it got destroyed by other means
*/
/obj/machinery/proc/on_deconstruction(disassembled)
PROTECTED_PROC(TRUE)
return
/obj/machinery/proc/can_be_overridden()
+6 -9
View File
@@ -91,15 +91,12 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/barsign, 32)
if((machine_stat & BROKEN) && !(obj_flags & NO_DECONSTRUCTION))
set_sign(new /datum/barsign/hiddensigns/signoff)
/obj/machinery/barsign/deconstruct(disassembled = TRUE)
if(!(obj_flags & NO_DECONSTRUCTION))
if(disassembled)
new disassemble_result(drop_location())
else
new /obj/item/stack/sheet/iron(drop_location(), 2)
new /obj/item/stack/cable_coil(drop_location(), 2)
qdel(src)
/obj/machinery/barsign/on_deconstruction(disassembled)
if(disassembled)
new disassemble_result(drop_location())
else
new /obj/item/stack/sheet/iron(drop_location(), 2)
new /obj/item/stack/cable_coil(drop_location(), 2)
/obj/machinery/barsign/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0)
switch(damage_type)
+14 -15
View File
@@ -443,21 +443,20 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/camera/xray, 0)
triggerCameraAlarm()
toggle_cam(null, 0)
/obj/machinery/camera/deconstruct(disassembled = TRUE)
if(!(obj_flags & NO_DECONSTRUCTION))
if(disassembled)
var/obj/structure/camera_assembly/assembly = assembly_ref?.resolve()
if(!assembly)
assembly = new()
assembly.forceMove(drop_location())
assembly.state = 1
assembly.setDir(dir)
assembly_ref = null
else
var/obj/item/I = new /obj/item/wallframe/camera (loc)
I.update_integrity(I.max_integrity * 0.5)
new /obj/item/stack/cable_coil(loc, 2)
qdel(src)
/obj/machinery/camera/on_deconstruction(disassembled)
if(disassembled)
var/obj/structure/camera_assembly/assembly = assembly_ref?.resolve()
if(!assembly)
assembly = new()
assembly.forceMove(drop_location())
assembly.state = 1
assembly.setDir(dir)
assembly_ref = null
return
var/obj/item/I = new /obj/item/wallframe/camera (loc)
I.update_integrity(I.max_integrity * 0.5)
new /obj/item/stack/cable_coil(loc, 2)
/obj/machinery/camera/update_icon_state() //TO-DO: Make panel open states, xray camera, and indicator lights overlays instead.
var/xray_module
+1 -2
View File
@@ -72,10 +72,9 @@
return
return ..()
/obj/machinery/cell_charger/deconstruct()
/obj/machinery/cell_charger/on_deconstruction(disassembled)
if(charging)
charging.forceMove(drop_location())
return ..()
/obj/machinery/cell_charger/Destroy()
QDEL_NULL(charging)
+19 -27
View File
@@ -98,33 +98,25 @@
if(prob(10))
atom_break(ENERGY)
/obj/machinery/computer/deconstruct(disassembled = TRUE, mob/user)
on_deconstruction()
if(!(obj_flags & NO_DECONSTRUCTION))
if(circuit) //no circuit, no computer frame
var/obj/structure/frame/computer/A = new /obj/structure/frame/computer(src.loc)
A.setDir(dir)
A.circuit = circuit
// Circuit removal code is handled in /obj/machinery/Exited()
circuit.forceMove(A)
A.set_anchored(TRUE)
if(machine_stat & BROKEN)
if(user)
to_chat(user, span_notice("The broken glass falls out."))
else
playsound(src, 'sound/effects/hit_on_shattered_glass.ogg', 70, TRUE)
new /obj/item/shard(drop_location())
new /obj/item/shard(drop_location())
A.state = 3
A.icon_state = "3"
else
if(user)
to_chat(user, span_notice("You disconnect the monitor."))
A.state = 4
A.icon_state = "4"
for(var/obj/C in src)
C.forceMove(loc)
qdel(src)
/obj/machinery/computer/spawn_frame(disassembled)
if(QDELETED(circuit)) //no circuit, no computer frame
return
var/obj/structure/frame/computer/A = new /obj/structure/frame/computer(src.loc)
A.setDir(dir)
A.circuit = circuit
// Circuit removal code is handled in /obj/machinery/Exited()
circuit.forceMove(A)
A.set_anchored(TRUE)
if(machine_stat & BROKEN)
playsound(src, 'sound/effects/hit_on_shattered_glass.ogg', 70, TRUE)
new /obj/item/shard(drop_location())
new /obj/item/shard(drop_location())
A.state = 3
A.icon_state = "3"
else
A.state = 4
A.icon_state = "4"
/obj/machinery/computer/AltClick(mob/user)
. = ..()
+1 -1
View File
@@ -138,6 +138,6 @@
QDEL_NULL(occupier)
return ..()
/obj/machinery/computer/aifixer/on_deconstruction()
/obj/machinery/computer/aifixer/on_deconstruction(disassembled)
if(occupier)
QDEL_NULL(occupier)
@@ -3,9 +3,8 @@
/// ID card currently inserted into the computer.
VAR_FINAL/obj/item/card/id/advanced/prisoner/contained_id
/obj/machinery/computer/prisoner/deconstruct(disassembled, mob/user)
/obj/machinery/computer/prisoner/on_deconstruction(disassembled)
contained_id?.forceMove(drop_location())
return ..()
/obj/machinery/computer/prisoner/Destroy()
QDEL_NULL(contained_id)
+2 -4
View File
@@ -21,10 +21,8 @@
result_path = /obj/machinery/computer/security/telescreen
pixel_shift = 32
/obj/machinery/computer/security/telescreen/deconstruct(disassembled = TRUE)
if(!(obj_flags & NO_DECONSTRUCTION))
new frame_type(loc)
qdel(src)
/obj/machinery/computer/security/telescreen/on_deconstruction(disassembled)
new frame_type(loc)
/obj/machinery/computer/security/telescreen/update_icon_state()
icon_state = initial(icon_state)
+1 -4
View File
@@ -69,16 +69,13 @@
. = ..()
emag_act()
/obj/machinery/digital_clock/deconstruct(disassembled = TRUE)
if(obj_flags & NO_DECONSTRUCTION)
return
/obj/machinery/digital_clock/on_deconstruction(disassembled)
if(disassembled)
new /obj/item/wallframe/digital_clock(drop_location())
else
new /obj/item/stack/sheet/iron(drop_location(), 2)
new /obj/item/shard(drop_location())
new /obj/item/shard(drop_location())
qdel(src)
/obj/machinery/digital_clock/Initialize(mapload)
. = ..()
+24 -30
View File
@@ -1511,38 +1511,32 @@
assembly.update_name()
assembly.update_appearance()
/obj/machinery/door/airlock/deconstruct(disassembled = TRUE, mob/user)
if(!(obj_flags & NO_DECONSTRUCTION))
var/obj/structure/door_assembly/A
if(assemblytype)
A = new assemblytype(loc)
else
A = new /obj/structure/door_assembly(loc)
//If you come across a null assemblytype, it will produce the default assembly instead of disintegrating.
prepare_deconstruction_assembly(A)
/obj/machinery/door/airlock/on_deconstruction(disassembled)
var/obj/structure/door_assembly/A
if(assemblytype)
A = new assemblytype(loc)
else
A = new /obj/structure/door_assembly(loc)
//If you come across a null assemblytype, it will produce the default assembly instead of disintegrating.
prepare_deconstruction_assembly(A)
if(!disassembled)
A?.update_integrity(A.max_integrity * 0.5)
else if(obj_flags & EMAGGED)
if(user)
to_chat(user, span_warning("You discard the damaged electronics."))
else
if(user)
to_chat(user, span_notice("You remove the airlock electronics."))
var/obj/item/electronics/airlock/ae
if(!electronics)
ae = new/obj/item/electronics/airlock(loc)
if(length(req_one_access))
ae.one_access = 1
ae.accesses = req_one_access
else
ae.accesses = req_access
if(!disassembled)
A?.update_integrity(A.max_integrity * 0.5)
else if(obj_flags & EMAGGED)
//no electronics nothing
else
var/obj/item/electronics/airlock/ae
if(!electronics)
ae = new/obj/item/electronics/airlock(loc)
if(length(req_one_access))
ae.one_access = 1
ae.accesses = req_one_access
else
ae = electronics
electronics = null
ae.forceMove(drop_location())
qdel(src)
ae.accesses = req_access
else
ae = electronics
electronics = null
ae.forceMove(drop_location())
/obj/machinery/door/airlock/rcd_vals(mob/user, obj/item/construction/rcd/the_rcd)
switch(the_rcd.mode)
+11 -13
View File
@@ -658,20 +658,18 @@
if(old_activity != active) //Something changed while we were sleeping
correct_state() //So we should re-evaluate our state
/obj/machinery/door/firedoor/deconstruct(disassembled = TRUE)
if(!(obj_flags & NO_DECONSTRUCTION))
var/turf/targetloc = get_turf(src)
if(disassembled || prob(40))
var/obj/structure/firelock_frame/unbuilt_lock = new assemblytype(targetloc)
if(disassembled)
unbuilt_lock.constructionStep = CONSTRUCTION_PANEL_OPEN
else
unbuilt_lock.constructionStep = CONSTRUCTION_NO_CIRCUIT
unbuilt_lock.update_integrity(unbuilt_lock.max_integrity * 0.5)
unbuilt_lock.update_appearance()
/obj/machinery/door/firedoor/on_deconstruction(disassembled)
var/turf/targetloc = get_turf(src)
if(disassembled || prob(40))
var/obj/structure/firelock_frame/unbuilt_lock = new assemblytype(targetloc)
if(disassembled)
unbuilt_lock.constructionStep = CONSTRUCTION_PANEL_OPEN
else
new /obj/item/electronics/firelock (targetloc)
qdel(src)
unbuilt_lock.constructionStep = CONSTRUCTION_NO_CIRCUIT
unbuilt_lock.update_integrity(unbuilt_lock.max_integrity * 0.5)
unbuilt_lock.update_appearance()
else
new /obj/item/electronics/firelock (targetloc)
/obj/machinery/door/firedoor/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
+10 -9
View File
@@ -301,15 +301,16 @@
playsound(src, 'sound/items/welder.ogg', 100, TRUE)
/obj/machinery/door/window/deconstruct(disassembled = TRUE)
if(!(obj_flags & NO_DECONSTRUCTION) && !disassembled)
for(var/i in 1 to shards)
drop_debris(new /obj/item/shard(src))
if(rods)
drop_debris(new /obj/item/stack/rods(src, rods))
if(cable)
drop_debris(new /obj/item/stack/cable_coil(src, cable))
qdel(src)
/obj/machinery/door/window/on_deconstruction(disassembled)
if(disassembled)
return
for(var/i in 1 to shards)
drop_debris(new /obj/item/shard(src))
if(rods)
drop_debris(new /obj/item/stack/rods(src, rods))
if(cable)
drop_debris(new /obj/item/stack/cable_coil(src, cable))
/obj/machinery/door/window/proc/drop_debris(obj/item/debris)
debris.forceMove(loc)
-5
View File
@@ -260,11 +260,6 @@
if(break_sound)
playsound(src, break_sound, 50, TRUE)
/obj/machinery/drone_dispenser/deconstruct(disassembled = TRUE)
if(!(obj_flags & NO_DECONSTRUCTION))
new /obj/item/stack/sheet/iron(loc, 5)
qdel(src)
#undef DRONE_PRODUCTION
#undef DRONE_RECHARGING
#undef DRONE_READY
+8 -10
View File
@@ -440,16 +440,14 @@
return
return ..()
/obj/machinery/firealarm/deconstruct(disassembled = TRUE)
if(!(obj_flags & NO_DECONSTRUCTION))
new /obj/item/stack/sheet/iron(loc, 1)
if(buildstage > FIRE_ALARM_BUILD_NO_CIRCUIT)
var/obj/item/item = new /obj/item/electronics/firealarm(loc)
if(!disassembled)
item.update_integrity(item.max_integrity * 0.5)
if(buildstage > FIRE_ALARM_BUILD_NO_WIRES)
new /obj/item/stack/cable_coil(loc, 3)
qdel(src)
/obj/machinery/firealarm/on_deconstruction(disassembled)
new /obj/item/stack/sheet/iron(loc, 1)
if(buildstage > FIRE_ALARM_BUILD_NO_CIRCUIT)
var/obj/item/item = new /obj/item/electronics/firealarm(loc)
if(!disassembled)
item.update_integrity(item.max_integrity * 0.5)
if(buildstage > FIRE_ALARM_BUILD_NO_WIRES)
new /obj/item/stack/cable_coil(loc, 3)
// Allows users to examine the state of the thermal sensor
/obj/machinery/firealarm/examine(mob/user)
+10 -12
View File
@@ -144,18 +144,16 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/flasher, 26)
bulb.burn_out()
power_change()
/obj/machinery/flasher/deconstruct(disassembled = TRUE)
if(!(obj_flags & NO_DECONSTRUCTION))
if(bulb)
bulb.forceMove(loc)
if(disassembled)
var/obj/item/wallframe/flasher/flasher_obj = new(get_turf(src))
transfer_fingerprints_to(flasher_obj)
flasher_obj.id = id
playsound(loc, 'sound/items/deconstruct.ogg', 50, TRUE)
else
new /obj/item/stack/sheet/iron (loc, 2)
qdel(src)
/obj/machinery/flasher/on_deconstruction(disassembled)
if(bulb)
bulb.forceMove(loc)
if(disassembled)
var/obj/item/wallframe/flasher/flasher_obj = new(get_turf(src))
transfer_fingerprints_to(flasher_obj)
flasher_obj.id = id
playsound(loc, 'sound/items/deconstruct.ogg', 50, TRUE)
else
new /obj/item/stack/sheet/iron (loc, 2)
/obj/machinery/flasher/portable //Portable version of the flasher. Only flashes when anchored
name = "portable flasher"
+5 -9
View File
@@ -55,11 +55,9 @@
deconstruct(TRUE)
return ITEM_INTERACT_SUCCESS
/obj/machinery/igniter/deconstruct(disassembled)
if(!(obj_flags & NO_DECONSTRUCTION))
new /obj/item/stack/sheet/iron(loc, 5)
new /obj/item/assembly/igniter(loc)
return ..()
/obj/machinery/igniter/on_deconstruction(disassembled)
new /obj/item/stack/sheet/iron(loc, 5)
new /obj/item/assembly/igniter(loc)
/obj/machinery/igniter/multitool_act(mob/living/user, obj/item/tool)
var/change_id = tgui_input_number(user, "Set the igniter controller's ID", "Igniter ID", id, 100)
@@ -200,10 +198,8 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/sparker, 26)
deconstruct(TRUE)
return ITEM_INTERACT_SUCCESS
/obj/machinery/sparker/deconstruct(disassembled)
if(!(obj_flags & NO_DECONSTRUCTION))
new /obj/item/wallframe/sparker(loc)
return ..()
/obj/machinery/sparker/on_deconstruction(disassembled)
new /obj/item/wallframe/sparker(loc)
/obj/machinery/sparker/multitool_act(mob/living/user, obj/item/tool)
var/change_id = tgui_input_number(user, "Set the sparker controller's ID", "Sparker ID", id, 100)
+1 -6
View File
@@ -164,16 +164,11 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/incident_display/tram, 32)
delam_record = rand(1,99)
update_appearance()
/obj/machinery/incident_display/deconstruct()
if(obj_flags & NO_DECONSTRUCTION)
return
/obj/machinery/incident_display/on_deconstruction(disassembled)
new /obj/item/stack/sheet/mineral/titanium(drop_location(), 2)
new /obj/item/shard(drop_location())
new /obj/item/shard(drop_location())
qdel(src)
/obj/machinery/incident_display/proc/update_delam_count(new_count, record)
delam_record = record
last_delam = min(new_count, 199)
+2 -4
View File
@@ -217,10 +217,8 @@
return ..()
set_transfer_rate(transfer_rate > MIN_IV_TRANSFER_RATE ? MIN_IV_TRANSFER_RATE : MAX_IV_TRANSFER_RATE)
/obj/machinery/iv_drip/deconstruct(disassembled = TRUE)
if(!(obj_flags & NO_DECONSTRUCTION))
new /obj/item/stack/sheet/iron(loc)
qdel(src)
/obj/machinery/iv_drip/on_deconstruction(disassembled = TRUE)
new /obj/item/stack/sheet/iron(loc)
/obj/machinery/iv_drip/process(seconds_per_tick)
if(!attached)
+2 -4
View File
@@ -107,10 +107,8 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/light_switch, 26)
if(!(machine_stat & (BROKEN|NOPOWER)))
power_change()
/obj/machinery/light_switch/deconstruct(disassembled = TRUE)
if(!(obj_flags & NO_DECONSTRUCTION))
new /obj/item/wallframe/light_switch(loc)
qdel(src)
/obj/machinery/light_switch/on_deconstruction(disassembled)
new /obj/item/wallframe/light_switch(loc)
/obj/item/wallframe/light_switch
name = "light switch"
+1 -1
View File
@@ -116,7 +116,7 @@
return data
/obj/machinery/limbgrower/on_deconstruction()
/obj/machinery/limbgrower/on_deconstruction(disassembled)
for(var/obj/item/reagent_containers/cup/our_beaker in component_parts)
reagents.trans_to(our_beaker, our_beaker.reagents.maximum_volume)
return ..()
@@ -534,12 +534,10 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/newscaster, 30)
playsound(src.loc, 'sound/items/welder.ogg', 100, TRUE)
/obj/machinery/newscaster/deconstruct(disassembled = TRUE)
if(!(obj_flags & NO_DECONSTRUCTION))
new /obj/item/stack/sheet/iron(loc, 2)
new /obj/item/shard(loc)
new /obj/item/shard(loc)
qdel(src)
/obj/machinery/newscaster/on_deconstruction(disassembled)
new /obj/item/stack/sheet/iron(loc, 2)
new /obj/item/shard(loc)
new /obj/item/shard(loc)
/obj/machinery/newscaster/atom_break(damage_flag)
. = ..()
@@ -402,9 +402,6 @@ DEFINE_BITFIELD(turret_flags, list(
/obj/machinery/porta_turret/proc/reset_attacked()
turret_flags &= ~TURRET_FLAG_SHOOT_ALL_REACT
/obj/machinery/porta_turret/deconstruct(disassembled = TRUE)
qdel(src)
/obj/machinery/porta_turret/atom_break(damage_flag)
. = ..()
if(.)
+1 -1
View File
@@ -247,7 +247,7 @@
L.Unconscious(100)
L.adjustBruteLoss(crush_damage)
/obj/machinery/recycler/on_deconstruction()
/obj/machinery/recycler/on_deconstruction(disassembled)
safety_mode = TRUE
/obj/machinery/recycler/deathtrap
+2 -4
View File
@@ -394,10 +394,8 @@ GLOBAL_LIST_EMPTY(req_console_ckey_departments)
return
return ..()
/obj/machinery/requests_console/deconstruct(disassembled = TRUE)
if(!(obj_flags & NO_DECONSTRUCTION))
new /obj/item/wallframe/requests_console(loc)
qdel(src)
/obj/machinery/requests_console/on_deconstruction(disassembled)
new /obj/item/wallframe/requests_console(loc)
/obj/machinery/requests_console/auto_name // Register an autoname variant and then make the directional helpers before undefing all the magic bits
auto_name = TRUE
+1 -1
View File
@@ -81,7 +81,7 @@
set_panel_open(TRUE)
QDEL_NULL(cell)
/obj/machinery/space_heater/on_deconstruction()
/obj/machinery/space_heater/on_deconstruction(disassembled)
if(cell)
LAZYADD(component_parts, cell)
cell = null
+1 -4
View File
@@ -72,16 +72,13 @@
update_appearance()
return TRUE
/obj/machinery/status_display/deconstruct(disassembled = TRUE)
if(obj_flags & NO_DECONSTRUCTION)
return
/obj/machinery/status_display/on_deconstruction(disassembled)
if(!disassembled)
new /obj/item/stack/sheet/iron(drop_location(), 2)
new /obj/item/shard(drop_location())
new /obj/item/shard(drop_location())
else
new /obj/item/wallframe/status_display(drop_location())
qdel(src)
/// Immediately change the display to the given picture.
/obj/machinery/status_display/proc/set_picture(state)
+3 -7
View File
@@ -307,13 +307,9 @@
storage = null
set_occupant(null)
/obj/machinery/suit_storage_unit/deconstruct(disassembled = TRUE)
if(!(obj_flags & NO_DECONSTRUCTION))
open_machine()
dump_inventory_contents()
if(card_reader_installed)
new /obj/item/stock_parts/card_reader(loc)
return ..()
/obj/machinery/suit_storage_unit/on_deconstruction(disassembled)
if(card_reader_installed)
new /obj/item/stock_parts/card_reader(loc)
/obj/machinery/suit_storage_unit/proc/access_check(mob/living/user)
if(!isnull(id_card))
+2 -4
View File
@@ -415,10 +415,8 @@ GLOBAL_LIST_INIT(dye_registry, list(
/obj/machinery/washing_machine/attack_ai_secondary(mob/user, modifiers)
return attack_hand_secondary(user, modifiers)
/obj/machinery/washing_machine/deconstruct(disassembled = TRUE)
if (!(obj_flags & NO_DECONSTRUCTION))
new /obj/item/stack/sheet/iron(drop_location(), 2)
qdel(src)
/obj/machinery/washing_machine/on_deconstruction(disassembled)
new /obj/item/stack/sheet/iron(drop_location(), 2)
/obj/machinery/washing_machine/open_machine(drop = TRUE, density_to_set = FALSE)
. = ..()
@@ -410,7 +410,7 @@ effective or pretty fucking useless.
balloon_alert(user, "repaired!")
/obj/machinery/porta_turret/syndicate/toolbox/deconstruct(disassembled)
/obj/machinery/porta_turret/syndicate/toolbox/on_deconstruction(disassembled)
if(disassembled)
var/atom/movable/old_toolbox = toolbox
toolbox = null
+1 -2
View File
@@ -315,11 +315,10 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/shower, (-16))
reagents.remove_any(SHOWER_SPRAY_VOLUME)
/obj/machinery/shower/deconstruct(disassembled = TRUE)
/obj/machinery/shower/on_deconstruction(disassembled = TRUE)
new /obj/item/stack/sheet/iron(drop_location(), 2)
if(has_water_reclaimer)
new /obj/item/stock_parts/water_recycler(drop_location())
qdel(src)
/obj/machinery/shower/proc/check_heat(mob/living/L)
var/mob/living/carbon/C = L
@@ -89,16 +89,14 @@
playsound(src, SFX_SPARKS, 50, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
return TRUE
/obj/machinery/airalarm/deconstruct(disassembled = TRUE)
if(!(obj_flags & NO_DECONSTRUCTION))
new /obj/item/stack/sheet/iron(loc, 2)
if((buildstage == AIR_ALARM_BUILD_NO_WIRES) || (buildstage == AIR_ALARM_BUILD_COMPLETE))
var/obj/item/electronics/airalarm/alarm = new(loc)
if(!disassembled)
alarm.take_damage(alarm.max_integrity * 0.5, sound_effect = FALSE)
if((buildstage == AIR_ALARM_BUILD_COMPLETE))
new /obj/item/stack/cable_coil(loc, 3)
qdel(src)
/obj/machinery/airalarm/on_deconstruction(disassembled = TRUE)
new /obj/item/stack/sheet/iron(loc, 2)
if((buildstage == AIR_ALARM_BUILD_NO_WIRES) || (buildstage == AIR_ALARM_BUILD_COMPLETE))
var/obj/item/electronics/airalarm/alarm = new(loc)
if(!disassembled)
alarm.take_damage(alarm.max_integrity * 0.5, sound_effect = FALSE)
if((buildstage == AIR_ALARM_BUILD_COMPLETE))
new /obj/item/stack/cable_coil(loc, 3)
/obj/machinery/airalarm/attackby(obj/item/W, mob/user, params)
update_last_used(user)
@@ -468,16 +468,16 @@
*
* Called by wrench_act(), create a pipe fitting and remove the pipe
*/
/obj/machinery/atmospherics/deconstruct(disassembled = TRUE)
if(!(obj_flags & NO_DECONSTRUCTION))
if(can_unwrench)
var/obj/item/pipe/stored = new construction_type(loc, null, dir, src, pipe_color)
stored.set_piping_layer(piping_layer)
if(!disassembled)
stored.take_damage(stored.max_integrity * 0.5, sound_effect=FALSE)
transfer_fingerprints_to(stored)
. = stored
..()
/obj/machinery/atmospherics/on_deconstruction(disassembled = TRUE)
if(!can_unwrench)
return
var/obj/item/pipe/stored = new construction_type(loc, null, dir, src, pipe_color)
stored.set_piping_layer(piping_layer)
if(!disassembled)
stored.take_damage(stored.max_integrity * 0.5, sound_effect=FALSE)
transfer_fingerprints_to(stored)
. = stored
/**
* Getter for piping layer shifted, pipe colored overlays
@@ -157,7 +157,7 @@
return TRUE
return ..()
/obj/machinery/atmospherics/components/binary/circulator/on_deconstruction()
/obj/machinery/atmospherics/components/binary/circulator/on_deconstruction(disassembled)
if(generator)
disconnectFromGenerator()
@@ -105,7 +105,7 @@
. = ..()
update_parents()
/obj/machinery/atmospherics/components/on_deconstruction()
/obj/machinery/atmospherics/components/on_deconstruction(disassembled)
relocate_airs()
return ..()
@@ -231,7 +231,7 @@
if(!panel_open)
balloon_alert(user, "open panel!")
return ITEM_INTERACT_SUCCESS
var/unsafe_wrenching = FALSE
var/filled_pipe = FALSE
var/datum/gas_mixture/environment_air = loc.return_air()
@@ -246,7 +246,7 @@
if(!filled_pipe)
default_deconstruction_crowbar(tool)
return ITEM_INTERACT_SUCCESS
to_chat(user, span_notice("You begin to unfasten \the [src]..."))
internal_pressure -= environment_air.return_pressure()
@@ -57,7 +57,7 @@
QDEL_NULL(cell)
return ..()
/obj/machinery/electrolyzer/on_deconstruction()
/obj/machinery/electrolyzer/on_deconstruction(disassembled)
if(cell)
LAZYADD(component_parts, cell)
cell = null
@@ -200,7 +200,7 @@
machine_parts = null
return..()
/obj/machinery/atmospherics/components/unary/hypertorus/core/on_deconstruction()
/obj/machinery/atmospherics/components/unary/hypertorus/core/on_deconstruction(disassembled)
var/turf/local_turf = get_turf(loc)
var/datum/gas_mixture/to_release = moderator_internal || internal_fusion
if(to_release == moderator_internal)
@@ -40,7 +40,7 @@
internal = new
register_context()
/obj/machinery/atmospherics/components/binary/crystallizer/on_deconstruction()
/obj/machinery/atmospherics/components/binary/crystallizer/on_deconstruction(disassembled)
var/turf/local_turf = get_turf(loc)
if(internal.total_moles())
local_turf.assume_air(internal)
@@ -67,7 +67,7 @@
return ..()
/obj/machinery/atmospherics/components/binary/crystallizer/crowbar_act(mob/living/user, obj/item/tool)
return crowbar_deconstruction_act(user, tool, internal.return_pressure())
return crowbar_deconstruction_act(user, tool, internal.return_pressure())
/obj/machinery/atmospherics/components/binary/crystallizer/update_overlays()
. = ..()
@@ -338,7 +338,7 @@
deconstruct(disassembled=TRUE)
to_chat(user, span_notice("You finish cutting open the sealed gas tank, revealing the innards."))
/obj/machinery/atmospherics/components/tank/deconstruct(disassembled)
/obj/machinery/atmospherics/components/tank/on_deconstruction(disassembled)
var/turf/location = drop_location()
. = ..()
location.assume_air(air_contents)
@@ -133,7 +133,7 @@
return ..()
/obj/machinery/cryo_cell/on_deconstruction()
/obj/machinery/cryo_cell/on_deconstruction(disassembled)
if(occupant)
occupant.vis_flags &= ~VIS_INHERIT_PLANE
REMOVE_TRAIT(occupant, TRAIT_IMMOBILIZED, CRYO_TRAIT)
@@ -134,10 +134,8 @@
deconstruct()
return TRUE
/obj/machinery/meter/deconstruct(disassembled = TRUE)
if(!(obj_flags & NO_DECONSTRUCTION))
new /obj/item/pipe_meter(loc)
. = ..()
/obj/machinery/meter/on_deconstruction(disassembled)
new /obj/item/pipe_meter(loc)
/obj/machinery/meter/interact(mob/user)
if(machine_stat & (NOPOWER|BROKEN))
@@ -353,10 +353,7 @@
/obj/machinery/portable_atmospherics/canister/atmos_expose(datum/gas_mixture/air, exposed_temperature)
take_damage(5, BURN, 0)
/obj/machinery/portable_atmospherics/canister/deconstruct(disassembled = TRUE)
if((obj_flags & NO_DECONSTRUCTION))
qdel(src)
return
/obj/machinery/portable_atmospherics/canister/on_deconstruction(disassembled = TRUE)
if(!(machine_stat & BROKEN))
canister_break()
if(!disassembled)
@@ -366,7 +363,6 @@
new /obj/item/stack/sheet/iron (drop_location(), 10)
if(internal_cell)
internal_cell.forceMove(drop_location())
qdel(src)
/obj/machinery/portable_atmospherics/canister/attackby(obj/item/item, mob/user, params)
if(istype(item, /obj/item/stock_parts/cell))
@@ -45,10 +45,9 @@
coffeepot = new /obj/item/reagent_containers/cup/coffeepot(src)
cartridge = new /obj/item/coffee_cartridge(src)
/obj/machinery/coffeemaker/deconstruct()
/obj/machinery/coffeemaker/on_deconstruction(disassembled)
coffeepot?.forceMove(drop_location())
cartridge?.forceMove(drop_location())
return ..()
/obj/machinery/coffeemaker/Destroy()
QDEL_NULL(coffeepot)
@@ -61,11 +61,10 @@ GLOBAL_LIST_INIT(oilfry_blacklisted_items, typecacheof(list(
QDEL_NULL(frying)
return ..()
/obj/machinery/deepfryer/deconstruct(disassembled)
/obj/machinery/deepfryer/on_deconstruction(disassembled)
// This handles nulling out frying via exited
if(frying)
frying.forceMove(drop_location())
return ..()
/obj/machinery/deepfryer/RefreshParts()
. = ..()
@@ -106,13 +106,11 @@
if(default_unfasten_wrench(user, I) != CANT_UNFASTEN)
return TRUE
/obj/machinery/grill/deconstruct(disassembled = TRUE)
/obj/machinery/grill/on_deconstruction(disassembled)
if(grilled_item)
finish_grill()
if(!(obj_flags & NO_DECONSTRUCTION))
new /obj/item/stack/sheet/iron(loc, 5)
new /obj/item/stack/rods(loc, 5)
..()
new /obj/item/stack/sheet/iron(loc, 5)
new /obj/item/stack/rods(loc, 5)
/obj/machinery/grill/attack_ai(mob/user)
return
@@ -211,12 +211,10 @@
ice_cream_icon.color = flavor.color
return ice_cream_icon
/obj/machinery/icecream_vat/deconstruct(disassembled = TRUE)
if(!(obj_flags & NO_DECONSTRUCTION))
new /obj/item/stack/sheet/iron(loc, 4)
/obj/machinery/icecream_vat/on_deconstruction(disassembled = TRUE)
new /obj/item/stack/sheet/iron(loc, 4)
if(custom_ice_cream_beaker)
custom_ice_cream_beaker.forceMove(loc)
qdel(src)
///Makes an ice cream cone of the make_type, using ingredients list as reagents used to make it. Puts in user's hand if possible.
/obj/machinery/icecream_vat/proc/make_cone(mob/user, make_type, list/ingredients)
@@ -105,7 +105,7 @@
itemized_ingredient.pixel_y = itemized_ingredient.base_pixel_y + rand(-5, 6)
return ..()
/obj/machinery/microwave/on_deconstruction()
/obj/machinery/microwave/on_deconstruction(disassembled)
eject()
return ..()
@@ -491,7 +491,7 @@
/obj/machinery/smartfridge/drying_rack/exchange_parts()
return
/obj/machinery/smartfridge/drying_rack/on_deconstruction()
/obj/machinery/smartfridge/drying_rack/on_deconstruction(disassembled)
new /obj/item/stack/sheet/mineral/wood(drop_location(), 10)
/obj/machinery/smartfridge/drying_rack/crowbar_act(mob/living/user, obj/item/tool)
+1 -2
View File
@@ -1184,9 +1184,8 @@
/obj/machinery/hydroponics/soil/CtrlClick(mob/user)
return //Soil has no electricity.
/obj/machinery/hydroponics/soil/deconstruct(disassembled)
/obj/machinery/hydroponics/soil/on_deconstruction(disassembled)
new /obj/item/stack/ore/glass(drop_location(), 3)
return ..()
///The usb port circuit
@@ -126,8 +126,7 @@
remove_boulder(pick(boulders_contained))
return SECONDARY_ATTACK_CONTINUE_CHAIN
/obj/machinery/bouldertech/deconstruct(disassembled)
. = ..()
/obj/machinery/bouldertech/on_deconstruction(disassembled)
if(length(contents))
for(var/obj/item/boulder/boulder in contents)
remove_boulder(boulder)
+2 -4
View File
@@ -39,10 +39,8 @@
tickets.Cut()
return ..()
/obj/machinery/ticket_machine/deconstruct(disassembled = TRUE)
if(!(obj_flags & NO_DECONSTRUCTION))
new /obj/item/wallframe/ticket_machine(loc)
qdel(src)
/obj/machinery/ticket_machine/on_deconstruction(disassembled = TRUE)
new /obj/item/wallframe/ticket_machine(loc)
MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/ticket_machine, 32)
+1 -1
View File
@@ -36,5 +36,5 @@
if(default_unfasten_wrench(user, tool) == SUCCESSFUL_UNFASTEN)
return ITEM_INTERACT_SUCCESS
/obj/machinery/iv_drip/plumbing/deconstruct(disassembled = TRUE)
/obj/machinery/iv_drip/plumbing/on_deconstruction(disassembled)
qdel(src)
+1 -3
View File
@@ -299,9 +299,7 @@
else
. += "The cover is closed."
/obj/machinery/power/apc/deconstruct(disassembled = TRUE)
if(obj_flags & NO_DECONSTRUCTION)
return
/obj/machinery/power/apc/on_deconstruction(disassembled = TRUE)
if(!(machine_stat & BROKEN))
set_broken()
if(opened != APC_COVER_REMOVED)
+1 -5
View File
@@ -384,10 +384,7 @@
if (prob(75))
electrocute_mob(user, get_area(src), src, (rand(7,10) * 0.1), TRUE)
/obj/machinery/light/deconstruct(disassembled = TRUE)
if(obj_flags & NO_DECONSTRUCTION)
qdel(src)
return
/obj/machinery/light/on_deconstruction(disassembled)
var/obj/structure/light_construct/new_light = null
var/current_stage = 2
if(!disassembled)
@@ -416,7 +413,6 @@
new_light.cell = real_cell
real_cell.forceMove(new_light)
cell = null
qdel(src)
/obj/machinery/light/attacked_by(obj/item/attacking_object, mob/living/user)
..()
+1 -1
View File
@@ -189,7 +189,7 @@
return ..()
/obj/machinery/power/smes/on_deconstruction()
/obj/machinery/power/smes/on_deconstruction(disassembled)
for(var/obj/item/stock_parts/cell/cell in component_parts)
cell.charge = (charge / capacity) * cell.maxcharge
+10 -12
View File
@@ -121,18 +121,16 @@
visually_turn(new_angle)
azimuth_current = new_angle
/obj/machinery/power/solar/deconstruct(disassembled = TRUE)
if(!(obj_flags & NO_DECONSTRUCTION))
if(disassembled)
var/obj/item/solar_assembly/S = locate() in src
if(S)
S.forceMove(loc)
S.give_glass(machine_stat & BROKEN)
else
playsound(src, SFX_SHATTER, 70, TRUE)
new /obj/item/shard(src.loc)
new /obj/item/shard(src.loc)
qdel(src)
/obj/machinery/power/solar/on_deconstruction(disassembled)
if(disassembled)
var/obj/item/solar_assembly/S = locate() in src
if(S)
S.forceMove(loc)
S.give_glass(machine_stat & BROKEN)
else
playsound(src, SFX_SHATTER, 70, TRUE)
new /obj/item/shard(src.loc)
new /obj/item/shard(src.loc)
/obj/machinery/power/solar/update_overlays()
. = ..()
@@ -42,7 +42,7 @@
SSair.stop_processing_machine(src)
return ..()
/obj/machinery/power/thermoelectric_generator/on_deconstruction()
/obj/machinery/power/thermoelectric_generator/on_deconstruction(disassembled)
null_circulators()
/obj/machinery/power/thermoelectric_generator/update_overlays()
+10 -12
View File
@@ -137,18 +137,16 @@
playsound(loc, 'sound/effects/glassbr3.ogg', 100, TRUE)
unset_control()
/obj/machinery/power/tracker/deconstruct(disassembled = TRUE)
if(!(obj_flags & NO_DECONSTRUCTION))
if(disassembled)
var/obj/item/solar_assembly/S = locate() in src
if(S)
S.forceMove(loc)
S.give_glass(machine_stat & BROKEN)
else
playsound(src, SFX_SHATTER, 70, TRUE)
new /obj/item/shard(src.loc)
new /obj/item/shard(src.loc)
qdel(src)
/obj/machinery/power/tracker/on_deconstruction(disassembled)
if(disassembled)
var/obj/item/solar_assembly/S = locate() in src
if(S)
S.forceMove(loc)
S.give_glass(machine_stat & BROKEN)
else
playsound(src, SFX_SHATTER, 70, TRUE)
new /obj/item/shard(src.loc)
new /obj/item/shard(src.loc)
// Tracker Electronic
+2 -2
View File
@@ -179,7 +179,7 @@
if(default_deconstruction_crowbar(tool))
return ITEM_INTERACT_SUCCESS
/obj/machinery/power/turbine/on_deconstruction()
/obj/machinery/power/turbine/on_deconstruction(disassembled)
installed_part?.forceMove(loc)
return ..()
@@ -547,7 +547,7 @@
disconnect_from_network()
SSair.stop_processing_machine(src)
/obj/machinery/power/turbine/core_rotor/on_deconstruction()
/obj/machinery/power/turbine/core_rotor/on_deconstruction(disassembled)
deactivate_parts()
return ..()
@@ -464,7 +464,7 @@
update_appearance()
return TRUE
/obj/machinery/chem_dispenser/on_deconstruction()
/obj/machinery/chem_dispenser/on_deconstruction(disassembled)
cell = null
if(beaker)
beaker.forceMove(drop_location())
@@ -25,7 +25,7 @@
create_reagents(200, NO_REACT)
register_context()
/obj/machinery/chem_heater/on_deconstruction()
/obj/machinery/chem_heater/on_deconstruction(disassembled)
beaker?.forceMove(drop_location())
/obj/machinery/chem_heater/Destroy()
@@ -58,14 +58,13 @@ This will not clean any inverted reagents. Inverted reagents will still be corre
for(var/datum/stock_part/micro_laser/laser in component_parts)
cms_coefficient /= laser.tier
/obj/machinery/chem_mass_spec/deconstruct(disassembled)
/obj/machinery/chem_mass_spec/on_deconstruction(disassembled)
if(beaker1)
beaker1.forceMove(drop_location())
beaker1 = null
if(beaker2)
beaker2.forceMove(drop_location())
beaker2 = null
. = ..()
/obj/machinery/chem_mass_spec/update_overlays()
. = ..()
@@ -59,7 +59,7 @@
QDEL_NULL(beaker)
return ..()
/obj/machinery/chem_master/on_deconstruction()
/obj/machinery/chem_master/on_deconstruction(disassembled)
replace_beaker()
return ..()
@@ -108,7 +108,7 @@
update_appearance()
SStgui.update_uis(src)
/obj/machinery/computer/pandemic/on_deconstruction()
/obj/machinery/computer/pandemic/on_deconstruction(disassembled)
eject_beaker()
. = ..()
@@ -42,11 +42,10 @@
QDEL_NULL(beaker)
update_appearance()
/obj/machinery/reagentgrinder/deconstruct()
/obj/machinery/reagentgrinder/on_deconstruction(disassmbled)
drop_all_items()
beaker?.forceMove(drop_location())
beaker = null
return ..()
/obj/machinery/reagentgrinder/Destroy()
QDEL_NULL(beaker)
@@ -111,10 +111,9 @@
return
return ..()
/obj/machinery/smoke_machine/deconstruct()
/obj/machinery/smoke_machine/on_deconstruction(disassembled)
reagents.expose(loc, TOUCH)
reagents.clear_reagents()
return ..()
/obj/machinery/smoke_machine/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
+9 -11
View File
@@ -276,20 +276,18 @@
H.vent_gas(loc)
qdel(H)
/obj/machinery/disposal/deconstruct(disassembled = TRUE)
/obj/machinery/disposal/on_deconstruction(disassembled)
var/turf/T = loc
if(!(obj_flags & NO_DECONSTRUCTION))
if(stored)
var/obj/structure/disposalconstruct/construct = stored
stored = null
construct.forceMove(T)
transfer_fingerprints_to(construct)
construct.set_anchored(FALSE)
construct.set_density(TRUE)
construct.update_appearance()
if(stored)
var/obj/structure/disposalconstruct/construct = stored
stored = null
construct.forceMove(T)
transfer_fingerprints_to(construct)
construct.set_anchored(FALSE)
construct.set_density(TRUE)
construct.update_appearance()
for(var/atom/movable/AM in src) //out, out, darned crowbar!
AM.forceMove(T)
..()
///How disposal handles getting a storage dump from a storage object
/obj/machinery/disposal/proc/on_storage_dump(datum/source, datum/storage/storage, mob/user)
@@ -295,7 +295,7 @@
return FALSE
tank_to_target = (tank_to_target == inserted_bomb.tank_one) ? inserted_bomb.tank_two : inserted_bomb.tank_one
/obj/machinery/research/anomaly_refinery/on_deconstruction()
/obj/machinery/research/anomaly_refinery/on_deconstruction(disassembled)
eject_bomb()
eject_core()
return ..()
@@ -6,7 +6,7 @@
production_animation = "protolathe_n"
allowed_buildtypes = PROTOLATHE
/obj/machinery/rnd/production/protolathe/deconstruct(disassembled)
/obj/machinery/rnd/production/protolathe/on_deconstruction(disassembled)
log_game("Protolathe of type [type] [disassembled ? "disassembled" : "deconstructed"] by [key_name(usr)] at [get_area_name(src, TRUE)]")
return ..()
@@ -237,7 +237,7 @@
else if (machine_stat & NOPOWER)
. += mutable_appearance(icon, "[base_icon_state]_screen-off")
/obj/machinery/doppler_array/on_deconstruction()
/obj/machinery/doppler_array/on_deconstruction(disassembled)
eject_disk()
. = ..()
@@ -238,7 +238,7 @@
update_appearance()
return ..()
/obj/machinery/atmospherics/components/binary/tank_compressor/on_deconstruction()
/obj/machinery/atmospherics/components/binary/tank_compressor/on_deconstruction(disassembled)
eject_tank()
eject_disk()
return ..()
+1 -1
View File
@@ -150,7 +150,7 @@
return TRUE
//we eject the loaded item when deconstructing the machine
/obj/machinery/rnd/on_deconstruction()
/obj/machinery/rnd/on_deconstruction(disassembled)
if(loaded_item)
loaded_item.forceMove(drop_location())
..()
+1 -1
View File
@@ -230,7 +230,7 @@
to_chat(user, span_notice("You delicately cut the wire. [hdd_wires] wire\s left..."))
return TRUE
/obj/machinery/rnd/server/master/on_deconstruction()
/obj/machinery/rnd/server/master/on_deconstruction(disassembled)
// If the machine contains a source code HDD, destroying it will negatively impact research speed. Safest to log this.
if(source_code_hdd)
// Destroyed with a hard drive inside = harm income
@@ -857,10 +857,7 @@
balloon_alert(user, "[panel_open ? "mounting bolts exposed" : "mounting bolts hidden"]")
return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN
/obj/machinery/transport/tram_controller/deconstruct(disassembled = TRUE)
if(obj_flags & NO_DECONSTRUCTION)
return
/obj/machinery/transport/tram_controller/on_deconstruction(disassembled)
var/turf/drop_location = find_obstruction_free_location(1, src)
if(disassembled)
@@ -868,7 +865,6 @@
else
new /obj/item/stack/sheet/mineral/titanium(drop_location, 2)
new /obj/item/stack/sheet/iron(drop_location, 1)
qdel(src)
/**
* Update the blinky lights based on the controller status, allowing to quickly check without opening up the cabinet.
+1 -4
View File
@@ -81,9 +81,7 @@
if(panel_open)
. += span_notice("It is secured to the tram wall with [EXAMINE_HINT("bolts.")]")
/obj/machinery/transport/destination_sign/deconstruct(disassembled = TRUE)
if(obj_flags & NO_DECONSTRUCTION)
return
/obj/machinery/transport/destination_sign/on_deconstruction(disassembled)
if(disassembled)
new /obj/item/wallframe/indicator_display(drop_location())
else
@@ -91,7 +89,6 @@
new /obj/item/stack/sheet/iron(drop_location(), 1)
new /obj/item/shard(drop_location())
new /obj/item/shard(drop_location())
qdel(src)
/obj/machinery/transport/destination_sign/indicator/wrench_act_secondary(mob/living/user, obj/item/tool)
. = ..()
+4 -7
View File
@@ -298,12 +298,10 @@
for(var/obj/item/vending_refill/installed_refill in component_parts)
restock(installed_refill)
/obj/machinery/vending/deconstruct(disassembled = TRUE)
/obj/machinery/vending/on_deconstruction(disassembled)
if(refill_canister)
return ..()
if(!(obj_flags & NO_DECONSTRUCTION)) //the non constructable vendors drop metal instead of a machine frame.
new /obj/item/stack/sheet/iron(loc, 3)
qdel(src)
new /obj/item/stack/sheet/iron(loc, 3)
/obj/machinery/vending/update_appearance(updates=ALL)
. = ..()
@@ -1085,7 +1083,7 @@
replacer.play_rped_sound()
return TRUE
/obj/machinery/vending/on_deconstruction()
/obj/machinery/vending/on_deconstruction(disassembled)
update_canister()
. = ..()
@@ -1656,14 +1654,13 @@
/obj/machinery/vending/custom/crowbar_act(mob/living/user, obj/item/attack_item)
return FALSE
/obj/machinery/vending/custom/deconstruct(disassembled)
/obj/machinery/vending/custom/on_deconstruction(disassembled)
unbuckle_all_mobs(TRUE)
var/turf/current_turf = get_turf(src)
if(current_turf)
for(var/obj/item/stored_item in contents)
stored_item.forceMove(current_turf)
explosion(src, devastation_range = -1, light_impact_range = 3)
return ..()
/**
* Vends an item to the user. Handles all the logic:
@@ -283,7 +283,7 @@
. = ..()
occupant_typecache = typecacheof(/mob/living/carbon)
/obj/machinery/bci_implanter/on_deconstruction()
/obj/machinery/bci_implanter/on_deconstruction(disassembled)
drop_stored_bci()
/obj/machinery/bci_implanter/Destroy()