From fb3ceb9cfc9e28b07d405090bc29ed0cf33b6713 Mon Sep 17 00:00:00 2001 From: Vile Beggar Date: Wed, 31 Jul 2024 19:41:15 +0200 Subject: [PATCH] stops structures from being built on dense objects --- code/game/objects/items/frames/table_rack.dm | 5 ++++- code/game/objects/items/stacks/stack.dm | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/code/game/objects/items/frames/table_rack.dm b/code/game/objects/items/frames/table_rack.dm index eda9b9c5749b..b8bc51d9ad08 100644 --- a/code/game/objects/items/frames/table_rack.dm +++ b/code/game/objects/items/frames/table_rack.dm @@ -59,7 +59,10 @@ if(istype(get_area(loc), /area/shuttle)) //HANGAR/SHUTTLE BUILDING to_chat(user, SPAN_WARNING("No. This area is needed for the dropship.")) return - + for(var/obj/object in OT) + if(object.density) + to_chat(user, SPAN_WARNING("[object] is blocking you from constructing the table!")) + return if(!do_after(user, 3 SECONDS, INTERRUPT_ALL, BUSY_ICON_BUILD)) to_chat(user, SPAN_WARNING("Hold still while you're constructing a table!")) return diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index 5f72e4a75567..9827e62a938d 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -197,6 +197,12 @@ Also change the icon to reflect the amount of sheets, if possible.*/ to_chat(usr, SPAN_WARNING("The [R.title] cannot be constructed on a tunnel!")) return + if(R.one_per_turf != ONE_TYPE_PER_BORDER) //all barricade-esque structures utilize this define and have their own check for object density. checking twice is unneeded. + for(var/obj/object in usr.loc) + if(object.density) + to_chat(usr, SPAN_WARNING("[object] is blocking you from constructing \the [R.title].")) + return + if((R.flags & RESULT_REQUIRES_SNOW) && !(istype(usr.loc, /turf/open/snow) || istype(usr.loc, /turf/open/auto_turf/snow))) to_chat(usr, SPAN_WARNING("The [R.title] must be built on snow!")) return