Enhances algorithm for finding an atom mount (#94076)

## About The Pull Request
Depends on #94064 for the unit test but offers a better method for
finding an atom to mount on
- Finding a mount now takes into consideration the objects pixel x & y
offsets meaning diagonal mounting is now supported. Gives great
flexibility for mappers
- If you don't want to use pixel offsets but default back to using the
objects direction that behaviour is still preserved. Useful if your
object uses directional icon states(lights & cameras for now) AND don't
use offsets
- If no direction could be specified then as the last resort it defaults
back to the objects local turf for mounting

## Changelog
🆑
fix: all mounted objects on tables, fences, windows & walls should fall
of correctly when the atom it is placed on is destroyed
fix: security telescreen now falls off when their mounted wall is
destroyed
fix: defib wall mount falls off when their mounted wall is destroyed
fix: floor lights are mounted to the ground/catwalk/tram floor they are
sitting on meaning destroying it will destroy the light
fix: wall mounted plaques now fall off when their mounted wall is
destroyed
/🆑
This commit is contained in:
SyncIt21
2025-12-12 12:23:22 -05:00
committed by nevimer
parent fc809d7687
commit f640a0e972
54 changed files with 228 additions and 139 deletions
+4 -1
View File
@@ -946,11 +946,11 @@
wallframe_type = /obj/item/wallframe/painting/large
/obj/structure/sign/painting/large/Initialize(mapload)
. = ..()
// Necessary so that the painting is framed correctly by the frame overlay when flipped.
ADD_KEEP_TOGETHER(src, INNATE_TRAIT)
if(mapload)
finalize_size()
return ..()
/**
* This frame is visually put between two wall turfs and it has an icon that's bigger than 32px, and because
@@ -973,6 +973,9 @@
if(EAST)
bound_height = 64
/obj/structure/sign/painting/large/get_turfs_to_mount_on()
return (!pixel_x && !pixel_y) ? list(get_step(src, dir)) : ..()
/obj/structure/sign/painting/large/frame_canvas(mob/living/user, obj/item/canvas/new_canvas)
. = ..()
if(.)