From 226ca2f9f35e8281d38081034e50d43a12658f65 Mon Sep 17 00:00:00 2001 From: SyncIt21 <110812394+SyncIt21@users.noreply.github.com> Date: Sun, 21 Dec 2025 22:55:05 +0530 Subject: [PATCH] Some wall mount improvements (#94499) ## About The Pull Request - Fixes #94497. Adds atom mount component directly but only for non shuttle areas - Hand placed posters are pixel shifted onto the wall and not directly force moved allowing for stuff like acid/fire to interact with them - Hand placing posters & signs apply the atom mounted component directly without calling `find_and_mount_on_atom()` ## Changelog :cl: code: improves code for placing posters and signs on walls fix: hand placed posters now interact with fire/acid on their mounted turf fix: wallframes in player hands gets consumed when mounted in shuttle areas /:cl: --- code/game/objects/effects/posters/poster.dm | 23 +++++++++++++++---- code/game/objects/items/wall_mounted.dm | 5 ++-- code/game/objects/structures/signs/_signs.dm | 2 +- .../modules/power/lighting/light_construct.dm | 5 +++- 4 files changed, 26 insertions(+), 9 deletions(-) diff --git a/code/game/objects/effects/posters/poster.dm b/code/game/objects/effects/posters/poster.dm index b093a15694d..1fe4e365691 100644 --- a/code/game/objects/effects/posters/poster.dm +++ b/code/game/objects/effects/posters/poster.dm @@ -73,6 +73,12 @@ if(!isclosedturf(wall_structure)) return NONE + var/turf/user_turf = get_turf(user) + var/dir = get_dir(user_turf, wall_structure) + if(!(dir in GLOB.cardinals)) + balloon_alert(user, "stand in line with wall!") + return ITEM_INTERACT_BLOCKING + // Deny placing posters on currently-diagonal walls, although the wall may change in the future. if (wall_structure.smoothing_flags & SMOOTH_DIAGONAL_CORNERS) for(var/overlay in wall_structure.overlays) @@ -93,11 +99,21 @@ balloon_alert(user, "hanging poster...") var/obj/structure/sign/poster/placed_poster = poster_structure || new poster_type(src) - placed_poster.poster_item_type = type - placed_poster.forceMove(wall_structure) + placed_poster.forceMove(user_turf) + placed_poster.setDir(dir) + switch(dir) + if(NORTH) + placed_poster.pixel_y = 32 + if(SOUTH) + placed_poster.pixel_y = -32 + if(EAST) + placed_poster.pixel_x = 32 + if(WEST) + placed_poster.pixel_x = -32 var/obj/item/shard/trap = locate() in contents if(trap) trap.forceMove(placed_poster) + placed_poster.poster_item_type = type poster_structure = null flick("poster_being_set", placed_poster) playsound(src, 'sound/items/poster/poster_being_created.ogg', 100, TRUE) @@ -108,8 +124,7 @@ placed_poster.roll_and_drop(user_drop_location, user) return ITEM_INTERACT_FAILURE - placed_poster.setDir(get_dir(user_drop_location, wall_structure)) - placed_poster.find_and_mount_on_atom() + placed_poster.AddComponent(/datum/component/atom_mounted, wall_structure) placed_poster.on_placed_poster(user) return ITEM_INTERACT_SUCCESS diff --git a/code/game/objects/items/wall_mounted.dm b/code/game/objects/items/wall_mounted.dm index 13eedcd3468..e99de590a36 100644 --- a/code/game/objects/items/wall_mounted.dm +++ b/code/game/objects/items/wall_mounted.dm @@ -49,9 +49,8 @@ hanging_object.pixel_x = pixel_shift if(WEST) hanging_object.pixel_x = -pixel_shift - if(!hanging_object.find_and_mount_on_atom()) - to_chat(user, span_warning("[src] Could not find all to mount on!.")) - return + if(!istype(get_area(user), /area/shuttle)) //due to turf changing issue we don't mount here for now + hanging_object.AddComponent(/datum/component/atom_mounted, support_structure) after_attach(hanging_object) qdel(src) diff --git a/code/game/objects/structures/signs/_signs.dm b/code/game/objects/structures/signs/_signs.dm index 7be5596412f..e1debb4aab1 100644 --- a/code/game/objects/structures/signs/_signs.dm +++ b/code/game/objects/structures/signs/_signs.dm @@ -207,7 +207,7 @@ playsound(target_turf, 'sound/items/deconstruct.ogg', 50, TRUE) placed_sign.update_integrity(get_integrity()) placed_sign.setDir(dir) - placed_sign.find_and_mount_on_atom() + placed_sign.AddComponent(/datum/component/atom_mounted, target_turf) qdel(src) return ITEM_INTERACT_SUCCESS diff --git a/code/modules/power/lighting/light_construct.dm b/code/modules/power/lighting/light_construct.dm index cb090f4ac7e..649207a9759 100644 --- a/code/modules/power/lighting/light_construct.dm +++ b/code/modules/power/lighting/light_construct.dm @@ -153,7 +153,10 @@ if("floor") new_light = new /obj/machinery/light/floor/empty(loc) new_light.setDir(dir) - new_light.find_and_mount_on_atom() + var/atom/support = get_step(src, dir) + if(!isclosedturf(support)) + support = locate(/obj/structure/window) in support + new_light.AddComponent(/datum/component/atom_mounted, support) transfer_fingerprints_to(new_light) if(!QDELETED(cell)) new_light.cell = cell