Skip to content

Commit

Permalink
Makes it easier to place tiles on multi-z holes (#2536)
Browse files Browse the repository at this point in the history
* Makes it easier to place tiles on multi-z holes (#77935)

Adds the "open space click handler" to tile stacks, which makes it so
you don't have to pixel hunt for a turf on the BELOW z level in order to
fix a hole.
This exists on rods and rpds since they're often used to fix holes.
But wasn't added to tiles when they were made to be able to fix holes
directly, without rods.

Additionally, closes #77540 by having the open space click handler loop
up z levels so that it works if you're clicking on items from multiple z
levels away.
The current behavior can be very frustrating to work around, and appears
to not be intended.
:cl:
fix: Made it easier to place tiles on multi z level holes
/:cl:

* Fix RCDing multi-z openspace

---------

Co-authored-by: FlufflesTheDog <[email protected]>
  • Loading branch information
Absolucy and FlufflesTheDog authored Jul 5, 2024
1 parent 5678825 commit ed0e9f2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions code/game/objects/items/rcd/RCD.dm
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,7 @@ GLOBAL_VAR_INIT(icon_holographic_window, init_holographic_window())
airlock_electronics.name = "Access Control"
airlock_electronics.holder = src
GLOB.rcd_list += src
AddElement(/datum/element/openspace_item_click_handler)

/obj/item/construction/rcd/Destroy()
QDEL_NULL(airlock_electronics)
Expand Down Expand Up @@ -611,6 +612,11 @@ GLOBAL_VAR_INIT(icon_holographic_window, init_holographic_window())

return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN

/obj/item/construction/rcd/handle_openspace_click(turf/target, mob/user, proximity_flag, click_parameters)
if((!proximity_flag && !ranged) || (ranged && !range_check(target, user)))
return
afterattack(target, user, TRUE, click_parameters)

/obj/item/construction/rcd/proc/detonate_pulse()
audible_message("<span class='danger'><b>[src] begins to vibrate and \
buzz loudly!</b></span>","<span class='danger'><b>[src] begins \
Expand Down
5 changes: 5 additions & 0 deletions code/game/objects/items/stacks/tiles/tile_types.dm
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
. = ..()
pixel_x = rand(-3, 3)
pixel_y = rand(-3, 3) //randomize a little
AddElement(/datum/element/openspace_item_click_handler)
if(tile_reskin_types)
tile_reskin_types = tile_reskin_list(tile_reskin_types)
if(tile_rotate_dirs)
Expand Down Expand Up @@ -100,6 +101,10 @@
playsound(target_plating, 'sound/weapons/genhit.ogg', 50, TRUE)
return target_plating

/obj/item/stack/tile/handle_openspace_click(turf/target, mob/user, proximity_flag, click_parameters)
if(proximity_flag)
target.attackby(src, user, click_parameters)

//Grass
/obj/item/stack/tile/grass
name = "grass tile"
Expand Down

0 comments on commit ed0e9f2

Please sign in to comment.