From 8a3776cc6161973fd08fbccbce0a5195ce492001 Mon Sep 17 00:00:00 2001 From: Jack Edge Date: Mon, 2 May 2016 12:47:35 +0100 Subject: [PATCH] Glass tables shatter more often - Glass tables do not break if they have the NODECONSTRUCT flag - Glass tables break if any living mob crosses them above small size and under the effects of gravity. --- code/game/objects/structures/tables_racks.dm | 34 +++++++++++--------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm index 1a1ece0837b..199c3ddae49 100644 --- a/code/game/objects/structures/tables_racks.dm +++ b/code/game/objects/structures/tables_racks.dm @@ -264,23 +264,27 @@ canSmoothWith = null health = 50 -/obj/structure/table/glass/tablepush(obj/item/I, mob/user) - if(..()) - visible_message("[src] breaks!") - playsound(src.loc, "shatter", 50, 1) - new frame(src.loc) - new /obj/item/weapon/shard(src.loc) - qdel(src) +/obj/structure/table/glass/Crossed(atom/movable/AM) + . = ..() + if(flags & NODECONSTRUCT) + return + // Don't break if they're just flying past + if(AM.throwing) + return + if(istype(AM, /mob/living)) + var/mob/living/M = AM + if(has_gravity(M) && M.mob_size > MOB_SIZE_SMALL) + table_shatter(M) -/obj/structure/table/glass/climb_structure(mob/user) - if(..()) - visible_message("[src] breaks!") - playsound(src.loc, "shatter", 50, 1) - new frame(src.loc) - new /obj/item/weapon/shard(src.loc) - qdel(src) - user.Weaken(5) +/obj/structure/table/glass/proc/table_shatter(mob/M) + visible_message("[src] breaks!") + playsound(src.loc, "shatter", 50, 1) + new frame(src.loc) + var/obj/item/weapon/shard/S = new(src.loc) + S.throw_impact(M) + M.Weaken(5) + qdel(src) /* * Wooden tables