mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-13 09:05:11 +01:00
Fixes some material datum bugs (#47049)
* fixes * chair * ass * fixes * dumb * done * fix
This commit is contained in:
@@ -54,8 +54,13 @@
|
||||
|
||||
/obj/structure/chair/deconstruct()
|
||||
// If we have materials, and don't have the NOCONSTRUCT flag
|
||||
if(buildstacktype && (!(flags_1 & NODECONSTRUCT_1)))
|
||||
new buildstacktype(loc,buildstackamount)
|
||||
if(!(flags_1 & NODECONSTRUCT_1))
|
||||
if(buildstacktype)
|
||||
new buildstacktype(loc,buildstackamount)
|
||||
else
|
||||
for(var/i in custom_materials)
|
||||
var/datum/material/M = i
|
||||
new M.sheet_type(loc, FLOOR(custom_materials[M] / MINERAL_MATERIAL_AMOUNT, 1))
|
||||
..()
|
||||
|
||||
/obj/structure/chair/attack_paw(mob/user)
|
||||
@@ -126,7 +131,7 @@
|
||||
/obj/structure/chair/greyscale
|
||||
material_flags = MATERIAL_ADD_PREFIX | MATERIAL_COLOR
|
||||
item_chair = /obj/item/chair/greyscale
|
||||
|
||||
buildstacktype = null //Custom mats handle this
|
||||
|
||||
/obj/structure/chair/wood
|
||||
icon_state = "wooden_chair"
|
||||
|
||||
@@ -45,14 +45,14 @@
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You start adding [material] to [src]...</span>")
|
||||
if(do_after(user, 20, target = src) && material.use(1))
|
||||
var/list/material_list
|
||||
var/list/material_list = list()
|
||||
if(material.material_type)
|
||||
material_list = list(material.material_type = MINERAL_MATERIAL_AMOUNT)
|
||||
material_list[material.material_type] = MINERAL_MATERIAL_AMOUNT
|
||||
make_new_table(/obj/structure/table/greyscale, material_list)
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/structure/table_frame/proc/make_new_table(table_type, list/custom_materials) //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) //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
|
||||
|
||||
@@ -194,7 +194,12 @@
|
||||
/obj/structure/table/deconstruct(disassembled = TRUE, wrench_disassembly = 0)
|
||||
if(!(flags_1 & NODECONSTRUCT_1))
|
||||
var/turf/T = get_turf(src)
|
||||
new buildstack(T, buildstackamount)
|
||||
if(buildstack)
|
||||
new buildstack(T, buildstackamount)
|
||||
else
|
||||
for(var/i in custom_materials)
|
||||
var/datum/material/M = i
|
||||
new M.sheet_type(T, FLOOR(custom_materials[M] / MINERAL_MATERIAL_AMOUNT, 1))
|
||||
if(!wrench_disassembly)
|
||||
new frame(T)
|
||||
else
|
||||
@@ -204,6 +209,7 @@
|
||||
|
||||
/obj/structure/table/greyscale
|
||||
material_flags = MATERIAL_ADD_PREFIX | MATERIAL_COLOR
|
||||
buildstack = null //No buildstack, so generate from mat datums
|
||||
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user