diff --git a/code/game/turfs/simulated/walls.dm b/code/game/turfs/simulated/walls.dm
index 4596512fe44..52086c6228c 100644
--- a/code/game/turfs/simulated/walls.dm
+++ b/code/game/turfs/simulated/walls.dm
@@ -25,11 +25,9 @@ var/list/global/wall_cache = list()
/turf/simulated/wall/New(var/newloc, var/materialtype, var/rmaterialtype)
..(newloc)
icon_state = "blank"
- if(!name_to_material)
- populate_material_list()
if(!materialtype)
materialtype = DEFAULT_WALL_MATERIAL
- material = name_to_material[materialtype]
+ material = get_material_by_name(materialtype)
if(!isnull(rmaterialtype))
reinf_material = name_to_material[rmaterialtype]
update_material()
diff --git a/code/modules/materials/materials.dm b/code/modules/materials/materials.dm
index 5afb1f27e04..c46ca8e7640 100644
--- a/code/modules/materials/materials.dm
+++ b/code/modules/materials/materials.dm
@@ -1,7 +1,7 @@
var/list/name_to_material
-/proc/populate_material_list()
- if(name_to_material) return // Already set up!
+/proc/populate_material_list(force_remake=0)
+ if(name_to_material && !force_remake) return // Already set up!
name_to_material = list()
for(var/type in typesof(/material) - /material)
var/material/new_mineral = new type
@@ -10,6 +10,12 @@ var/list/name_to_material
name_to_material[lowertext(new_mineral.name)] = new_mineral
return 1
+/proc/get_material_by_name(name)
+ if(!name_to_material)
+ populate_material_list()
+
+ return name_to_material[name]
+
/*
Valid sprite masks:
stone
@@ -102,6 +108,11 @@ var/list/name_to_material
icon_reinf = "reinf_over"
icon_colour = "#666666"
+/material/steel/holographic
+ name = "holographic [DEFAULT_WALL_MATERIAL]"
+ display_name = DEFAULT_WALL_MATERIAL
+ stack_type = null
+
/material/plasteel
name = "plasteel"
stack_type = /obj/item/stack/sheet/plasteel
@@ -159,6 +170,11 @@ var/list/name_to_material
icon_base = "solid"
explosion_resistance = 2
+/material/wood/holographic
+ name = "holographic wood"
+ display_name = "wood"
+ stack_type = null
+
/material/cult
name = "cult"
display_name = "disturbing stone"
diff --git a/code/modules/tables/flipping.dm b/code/modules/tables/flipping.dm
index 210498f1693..43697a938c7 100644
--- a/code/modules/tables/flipping.dm
+++ b/code/modules/tables/flipping.dm
@@ -5,7 +5,7 @@
var/obj/structure/table/T
for(var/angle in list(-90,90))
T = locate() in get_step(src.loc,turn(direction,angle))
- if(T && T.flipped == 0 && T.material == material)
+ if(T && T.flipped == 0 && T.material.name == material.name)
return 0
T = locate() in get_step(src.loc,direction)
if (!T || T.flipped == 1 || T.material != material)
@@ -50,7 +50,7 @@
L.Add(turn(src.dir,90))
for(var/new_dir in L)
var/obj/structure/table/T = locate() in get_step(src.loc,new_dir)
- if(T && T.material == material)
+ if(T && T.material.name == material.name)
if(T.flipped == 1 && T.dir == src.dir && !T.unflipping_check(new_dir))
return 0
return 1
@@ -90,7 +90,7 @@
flags |= ON_BORDER
for(var/D in list(turn(direction, 90), turn(direction, -90)))
var/obj/structure/table/T = locate() in get_step(src,D)
- if(T && T.flipped == 0 && T.material == material && material)
+ if(T && T.flipped == 0 && material && T.material && T.material.name == material.name)
T.flip(direction)
take_damage(rand(5, 20))
update_connections(1)
@@ -108,7 +108,7 @@
flags &= ~ON_BORDER
for(var/D in list(turn(dir, 90), turn(dir, -90)))
var/obj/structure/table/T = locate() in get_step(src.loc,D)
- if(T && T.flipped == 1 && T.dir == src.dir && T.material == material && material)
+ if(T && T.flipped == 1 && T.dir == src.dir && material && T.material&& T.material.name == material.name)
T.unflip()
update_connections(1)
diff --git a/code/modules/tables/presets.dm b/code/modules/tables/presets.dm
index 91badda696d..5f009e7e88c 100644
--- a/code/modules/tables/presets.dm
+++ b/code/modules/tables/presets.dm
@@ -1,38 +1,31 @@
-var/global/material/material_holographic_steel = null
-var/global/material/material_holographic_wood = null
-
/obj/structure/table
standard
icon_state = "plain_preview"
color = "#666666"
New()
- if(!name_to_material) populate_material_list()
- material = name_to_material[DEFAULT_WALL_MATERIAL]
+ material = get_material_by_name(DEFAULT_WALL_MATERIAL)
..()
reinforced
icon_state = "reinf_preview"
color = "#666666"
New()
- if(!name_to_material) populate_material_list()
- material = name_to_material[DEFAULT_WALL_MATERIAL]
- reinforced = name_to_material[DEFAULT_WALL_MATERIAL]
+ material = get_material_by_name(DEFAULT_WALL_MATERIAL)
+ reinforced = get_material_by_name(DEFAULT_WALL_MATERIAL)
..()
woodentable
icon_state = "plain_preview"
color = "#824B28"
New()
- if(!name_to_material) populate_material_list()
- material = name_to_material["wood"]
+ material = get_material_by_name("wood")
..()
gamblingtable
icon_state = "gamble_preview"
New()
- if(!name_to_material) populate_material_list()
- material = name_to_material["wood"]
+ material = get_material_by_name("wood")
carpeted = 1
..()
@@ -41,25 +34,18 @@ var/global/material/material_holographic_wood = null
color = "#00E1FF"
alpha = 77 // 0.3 * 255
New()
- if(!name_to_material) populate_material_list()
- material = name_to_material["glass"]
+ material = get_material_by_name("glass")
..()
holotable
icon_state = "holo_preview"
color = "#666666"
New()
- if(!material_holographic_steel)
- material_holographic_steel = new /material/steel
- material_holographic_steel.stack_type = null // Tables with null-stacktype materials cannot be deconstructed
- material = material_holographic_steel
+ material = get_material_by_name("holographic [DEFAULT_WALL_MATERIAL]")
..()
woodentable/holotable
icon_state = "holo_preview"
New()
- if(!material_holographic_wood)
- material_holographic_wood = new /material/wood
- material_holographic_wood.stack_type = null // Tables with null-stacktype materials cannot be deconstructed
- material = material_holographic_wood
+ material = get_material_by_name("holographic wood")
..()
diff --git a/code/modules/tables/tables.dm b/code/modules/tables/tables.dm
index 895938898a3..0414fe238ad 100644
--- a/code/modules/tables/tables.dm
+++ b/code/modules/tables/tables.dm
@@ -227,6 +227,8 @@
user.visible_message("\The [user] dismantles \the [src].",
"You dismantle \the [src].")
new /obj/item/stack/sheet/metal(src.loc)
+ qdel(src)
+ return
/obj/structure/table/proc/break_to_parts(full_return = 0)
if(reinforced && reinforced.stack_type && (full_return || prob(25)))
@@ -274,7 +276,7 @@
var/tabledirs = 0
for(var/direction in list(turn(dir,90), turn(dir,-90)) )
var/obj/structure/table/T = locate(/obj/structure/table ,get_step(src,direction))
- if (T && T.flipped == 1 && T.dir == src.dir && T.material == material)
+ if (T && T.flipped == 1 && T.dir == src.dir && T.material.name == material.name)
type++
tabledirs |= direction
@@ -351,7 +353,7 @@
for(var/obj/structure/table/T in oview(src, 1))
var/T_dir = get_dir(src, T)
if(T_dir in blocked_dirs) continue
- if(material == T.material && flipped == T.flipped)
+ if(material.name == T.material.name && flipped == T.flipped)
connection_dirs |= T_dir
if(propagate)
spawn(0)
diff --git a/icons/obj/tables.dmi b/icons/obj/tables.dmi
index 429969fc862..36de1b41836 100644
Binary files a/icons/obj/tables.dmi and b/icons/obj/tables.dmi differ