Skip to content

Commit

Permalink
https://github.com/tgstation/tgstation/pull/56156
Browse files Browse the repository at this point in the history
  • Loading branch information
Tsar-Salat committed Sep 16, 2023
1 parent cda94bb commit dd20bee
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion code/game/objects/structures/beds_chairs/chair.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
integrity_failure = 0.1
custom_materials = list(/datum/material/iron = 2000)
move_resist = MOVE_FORCE_WEAK
layer = OBJ_LAYER
var/buildstacktype = /obj/item/stack/sheet/iron
var/buildstackamount = 1
var/item_chair = /obj/item/chair // if null it can't be picked up
layer = OBJ_LAYER
/// Used to handle rotation properly, should only be 1, 4, or 8
var/possible_dirs = 4
var/colorable = FALSE
Expand Down
15 changes: 10 additions & 5 deletions code/game/objects/structures/table_frames.dm
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,13 @@
return
return ..()

/obj/structure/table_frame/proc/make_new_table(table_type, list/custom_materials, user = null) //makes sure the new table made retains what we had as a frame
/obj/structure/table_frame/proc/make_new_table(table_type, custom_materials, carpet_type, user = null) //makes sure the new table made retains what we had as a frame
var/obj/structure/table/T = new table_type(loc)
T.frame = type
T.framestack = framestack
T.framestackamount = framestackamount
if (carpet_type)
T.buildstack = carpet_type
if(custom_materials)
T.set_custom_materials(custom_materials)
qdel(src)
Expand Down Expand Up @@ -94,20 +96,22 @@
if (istype(I, /obj/item/stack))
var/obj/item/stack/material = I
var/toConstruct // stores the table variant
var/carpet_type // stores the carpet type used for construction in case of poker tables
if(istype(I, /obj/item/stack/sheet/wood))
toConstruct = /obj/structure/table/wood
else if(istype(I, /obj/item/stack/tile/carpet))
toConstruct = /obj/structure/table/wood/poker

carpet_type = I.type
if (toConstruct)
if(material.get_amount() < 1)
to_chat(user, "<span class='warning'>You need one [material.name] sheet to do this!</span>")
return
if(!check_turf_contents(user))
if(locate(/obj/structure/table) in loc)
to_chat(user, "<span class='warning'>There's already a table built here!</span>")
return
to_chat(user, "<span class='notice'>You start adding [material] to [src]...</span>")
if(do_after(user, 20, target = src) && material.use(1))
make_new_table(toConstruct)
make_new_table(toConstruct, null, carpet_type)
else
return ..()

Expand All @@ -125,7 +129,8 @@
if(W.get_amount() < 1)
to_chat(user, "<span class='warning'>You need one brass sheet to do this!</span>")
return
if(!check_turf_contents(user))
if(locate(/obj/structure/table) in loc)
to_chat(user, "<span class='warning'>There's already a table built here!</span>")
return
to_chat(user, "<span class='notice'>You start adding [W] to [src]...</span>")
if(do_after(user, 20, target = src) && W.use(1))
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/structures/tables_racks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@
qdel(src)

/obj/structure/table/greyscale
icon = 'icons/obj/smooth_structures/table_greyscale.dmi'
icon = 'icons/obj/smooth_structures/tables/table_greyscale.dmi'
icon_state = "table_greyscale-0"
base_icon_state = "table_greyscale"
material_flags = MATERIAL_ADD_PREFIX | MATERIAL_COLOR | MATERIAL_AFFECT_STATISTICS
Expand Down

0 comments on commit dd20bee

Please sign in to comment.