Fix invisible box on rotated multi-tile airlocks (#77736)

## About The Pull Request

Fixes airlock bounding box being incorrect when rotated leading to a
solid, invisible box on the adjacent tile. Icon states match airlock
direction.

## Changelog

🆑 LT3
fix: Rotated multi-tile airlocks display correctly and won't create an
invisible box next to itself
/🆑
This commit is contained in:
lessthanthree
2023-08-19 11:30:00 -07:00
committed by GitHub
parent 9520fb0b6a
commit bb4792cc0d
6 changed files with 17 additions and 18 deletions
+15
View File
@@ -1505,3 +1505,18 @@ GLOBAL_LIST_EMPTY(transformation_animation_objects)
var/size = size_check.Width() / world.icon_size
return size
/**
* Updates the bounds of a rotated object
* This ensures that the bounds are always correct,
* even if the object is rotated after init.
*/
/obj/proc/set_bounds()
var/size = get_size_in_tiles(src)
if(dir in list(NORTH, SOUTH))
bound_width = size * world.icon_size
bound_height = world.icon_size
else
bound_width = world.icon_size
bound_height = size * world.icon_size
-1
View File
@@ -2391,7 +2391,6 @@
multi_tile = TRUE
opacity = FALSE
glass = TRUE
bound_width = 64 // 2x1
/obj/structure/fluff/airlock_filler
name = "airlock fluff"
+2 -2
View File
@@ -70,8 +70,8 @@
AddElement(/datum/element/blocks_explosives)
. = ..()
set_init_door_layer()
if(bound_width > world.icon_size)
multi_tile = TRUE
if(multi_tile)
set_bounds()
set_filler()
update_overlays()
update_freelook_sight()
@@ -393,18 +393,3 @@
qdel(src)
return TRUE
return FALSE
/**
* Updates the bounds of the airlock assembly
* Sets the bounds of the airlock assembly according to the direction.
* This ensures that the bounds are always correct, even if the airlock is rotated.
*/
/obj/structure/door_assembly/multi_tile/proc/set_bounds()
var/size = get_size_in_tiles(src)
if(dir in list(NORTH, SOUTH))
bound_width = size * world.icon_size
bound_height = world.icon_size
else
bound_width = world.icon_size
bound_height = size * world.icon_size
Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 67 KiB