From 256e6ade19c804f7395ac4dac953329ce28ebfda Mon Sep 17 00:00:00 2001 From: Anewbe Date: Sat, 6 Jul 2019 20:33:56 -0500 Subject: [PATCH 1/2] Merge pull request #6267 from Heroman3003/carpetfix Fixes carpeted tables refunding wrong carpet type if nonstandard one was used --- code/modules/tables/tables.dm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/code/modules/tables/tables.dm b/code/modules/tables/tables.dm index 17d2a8e114..514c3b2036 100644 --- a/code/modules/tables/tables.dm +++ b/code/modules/tables/tables.dm @@ -26,6 +26,7 @@ var/list/table_icon_cache = list() // Gambling tables. I'd prefer reinforced with carpet/felt/cloth/whatever, but AFAIK it's either harder or impossible to get /obj/item/stack/material of those. // Convert if/when you can easily get stacks of these. var/carpeted = 0 + var/carpeted_type = /obj/item/stack/tile/carpet var/list/connections = list("nw0", "ne0", "sw0", "se0") @@ -110,7 +111,7 @@ var/list/table_icon_cache = list() if(carpeted && W.is_crowbar()) user.visible_message("\The [user] removes the carpet from \the [src].", "You remove the carpet from \the [src].") - new /obj/item/stack/tile/carpet(loc) + new carpeted_type(loc) carpeted = 0 update_icon() return 1 @@ -121,6 +122,7 @@ var/list/table_icon_cache = list() user.visible_message("\The [user] adds \the [C] to \the [src].", "You add \the [C] to \the [src].") carpeted = 1 + carpeted_type = W.type update_icon() return 1 else @@ -315,7 +317,7 @@ var/list/table_icon_cache = list() S = material.place_shard(loc) if(S) shards += S if(carpeted && (full_return || prob(50))) // Higher chance to get the carpet back intact, since there's no non-intact option - new /obj/item/stack/tile/carpet(src.loc) + new carpeted_type(src.loc) if(full_return || prob(20)) new /obj/item/stack/material/steel(src.loc) else