Make directional windows and windoors solid (#24484)

* Refactor away the useless checks of moving_diagonally.

* Single-directional windows and windoors now collide properly.

* Update code/game/objects/structures/window.dm

Co-authored-by: GDN <96800819+GDNgit@users.noreply.github.com>

* Allow exiting fulltile windows to north and east again.

---------

Co-authored-by: GDN <96800819+GDNgit@users.noreply.github.com>
This commit is contained in:
Charlie Nolan
2024-03-11 14:24:17 -07:00
committed by GitHub
parent 01a150a3dc
commit c2670cdadf
2 changed files with 19 additions and 19 deletions
+9 -7
View File
@@ -110,7 +110,7 @@
return 1
if(dir == FULLTILE_WINDOW_DIR)
return 0 //full tile window, you can't move into it!
if(get_dir(loc, target) == dir)
if(get_dir(loc, target) & dir)
return !density
if(istype(mover, /obj/structure/window))
var/obj/structure/window/W = mover
@@ -126,15 +126,17 @@
/obj/structure/window/CheckExit(atom/movable/O, target)
if(istype(O) && O.checkpass(PASSGLASS))
return 1
if(get_dir(O.loc, target) == dir)
return 0
return 1
return TRUE
if(dir == FULLTILE_WINDOW_DIR)
return TRUE
if(get_dir(O.loc, target) & dir)
return FALSE
return TRUE
/obj/structure/window/CanPathfindPass(obj/item/card/id/ID, to_dir, atom/movable/caller, no_id = FALSE)
if(!density)
return 1
if((dir == FULLTILE_WINDOW_DIR) || (dir == to_dir) || fulltile)
if((dir == FULLTILE_WINDOW_DIR) || (dir & to_dir) || fulltile)
return 0
return 1
@@ -414,7 +416,7 @@
/obj/structure/window/CanAtmosPass(turf/T)
if(!anchored || !density)
return TRUE
return !(FULLTILE_WINDOW_DIR == dir || dir == get_dir(loc, T))
return !(FULLTILE_WINDOW_DIR == dir || (dir & get_dir(loc, T)))
//This proc is used to update the icons of nearby windows.
/obj/structure/window/proc/update_nearby_icons()