Skip to content

Commit

Permalink
deconstruct тоже
Browse files Browse the repository at this point in the history
  • Loading branch information
skifsky committed Jul 31, 2024
1 parent 00afa3d commit 58b6057
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions modular_ss220/aesthetics/racks/code/racks.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
/obj/structure/rack
icon = 'modular_ss220/aesthetics/racks/icons/racks.dmi'
var/parts_type = /obj/item/rack_parts

/obj/structure/rack/deconstruct(disassembled = TRUE)
if(flags & NODECONSTRUCT)
return

density = FALSE
var/obj/item/rack_parts/newparts = new parts_type(loc)
transfer_fingerprints_to(newparts)
del(src)

/obj/item/rack_parts
var/rack_type = /obj/structure/rack
Expand All @@ -24,6 +34,7 @@
name = "gun rack"
desc = "Стойка для хранения оружия."
icon_state = "gunrack"
parts_type = /obj/item/rack_parts/gun

/obj/item/gun
var/on_rack = FALSE
Expand Down Expand Up @@ -91,15 +102,11 @@
gun_inside.place_on_rack()

/obj/structure/rack/gunrack/deconstruct(disassembled = TRUE)
if(!(flags & NODECONSTRUCT))
density = FALSE
var/obj/item/rack_parts/gun/newparts = new(loc)
transfer_fingerprints_to(newparts)
for(var/obj/item/I in loc.contents)
if(istype(I, /obj/item/gun))
var/obj/item/gun/to_remove = I
to_remove.remove_from_rack()
qdel(src)
. = ..()

/obj/item/rack_parts/gun
name = "gun rack parts"
Expand All @@ -112,6 +119,7 @@
name = "shelving"
desc = "Стеллаж для хранения различных вещей."
icon_state = "shelving"
parts_type = /obj/item/rack_parts/shelf

/obj/structure/rack/shelving/attackby(obj/item/stuff, mob/user, params)
. = ..()
Expand All @@ -138,13 +146,6 @@
stuff.pixel_x = clamp(text2num(click_icon_x) - 16, min_pixelshift, max_pixelshift)
stuff.pixel_y = clamp(text2num(click_icon_y ) - 16, min_pixelshift, max_pixelshift)

/obj/structure/rack/shelving/deconstruct(disassembled = TRUE)
if(!(flags & NODECONSTRUCT))
density = FALSE
var/obj/item/rack_parts/shelf/newparts = new(loc)
transfer_fingerprints_to(newparts)
qdel(src)

/obj/item/rack_parts/shelf
name = "shelving parts"
desc = "Детали для сборки стеллажа."
Expand Down

0 comments on commit 58b6057

Please sign in to comment.