Files
Bubberstation/modular_skyrat/modules/primitive_structures/code/storage_structures.dm
T
1a2f667433 [MIRROR] Removes machine deconstruct overrides that overrides their deletion [MDB IGNORE] (#24965)
* Removes machine deconstruct overrides that overrides their deletion (#79662)

## About The Pull Request

Both the PDA painter and the emergency shield generator override the
behaviour of deleting themselves when they are supposed to be destroyed,
instead redirecting to `atom_break` for some reason. This seems to be
very old behaviour and it does not fit with what `take_damage` expects
(it does not allow for damage to be taken past 0 integrity, aka it
should not *exist* past 0 integrity)
## Why It's Good For The Game

Fixes #68263
Annoying runtimes and annoying behaviour, especially during a
delamination.
## Changelog
🆑
fix: The PDA painter and the emergency shield generator can now be
destroyed.
/🆑

* Removes machine deconstruct overrides that overrides their deletion

---------

Co-authored-by: distributivgesetz <distributivgesetz93@gmail.com>
2023-11-13 11:27:31 +00:00

53 lines
1.9 KiB
Plaintext

// Wooden shelves that force items placed on them to be visually placed them
/obj/structure/rack/wooden
name = "shelf"
icon_state = "shelf_wood"
icon = 'modular_skyrat/modules/primitive_structures/icons/storage.dmi'
resistance_flags = FLAMMABLE
flags_1 = NODECONSTRUCT_1
/obj/structure/rack/wooden/MouseDrop_T(obj/object, mob/user, params)
. = ..()
var/list/modifiers = params2list(params)
if(!LAZYACCESS(modifiers, ICON_X) || !LAZYACCESS(modifiers, ICON_Y))
return
object.pixel_x = clamp(text2num(LAZYACCESS(modifiers, ICON_X)) - 16, -(world.icon_size / 3), world.icon_size / 3)
object.pixel_y = text2num(LAZYACCESS(modifiers, ICON_Y)) > 16 ? 10 : -4
/obj/structure/rack/wooden/crowbar_act(mob/living/user, obj/item/tool)
user.balloon_alert_to_viewers("disassembling...")
if(!tool.use_tool(src, user, 2 SECONDS, volume = 100))
return
new /obj/item/stack/sheet/mineral/clay(drop_location(), 5)
deconstruct(TRUE)
return TOOL_ACT_TOOLTYPE_SUCCESS
/obj/structure/rack/wooden/deconstruct(disassembled = TRUE)
new /obj/item/stack/sheet/mineral/wood(drop_location(), 2)
return ..()
// Barrel but it works like a crate
/obj/structure/closet/crate/wooden/storage_barrel
name = "storage barrel"
desc = "This barrel can't hold liquids, it can just hold things inside of it however!"
icon_state = "barrel"
base_icon_state = "barrel"
icon = 'modular_skyrat/modules/primitive_structures/icons/storage.dmi'
resistance_flags = FLAMMABLE
flags_1 = NODECONSTRUCT_1
/obj/structure/closet/crate/wooden/storage_barrel/crowbar_act(mob/living/user, obj/item/tool)
user.balloon_alert_to_viewers("disassembling...")
if(!tool.use_tool(src, user, 2 SECONDS, volume = 100))
return
new /obj/item/stack/sheet/mineral/clay(drop_location(), 5)
deconstruct(TRUE)
return TOOL_ACT_TOOLTYPE_SUCCESS
/obj/structure/closet/crate/wooden/storage_barrel/deconstruct(disassembled = TRUE)
new /obj/item/stack/sheet/mineral/wood(drop_location(), 4)
return ..()