mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 12:07:27 +01:00
Fixes railings and bot pathing (#18692)
* fixes railing bot pathing * lol railing corners * charlie optimisation * AA
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
pass_flags = LETPASSTHROW
|
||||
climbable = TRUE
|
||||
layer = ABOVE_MOB_LAYER
|
||||
flags = ON_BORDER
|
||||
var/currently_climbed = FALSE
|
||||
var/mover_dir = null
|
||||
|
||||
@@ -60,6 +61,9 @@
|
||||
/obj/structure/railing/corner/CanPass()
|
||||
return TRUE
|
||||
|
||||
/obj/structure/railing/corner/CanAStarPass(ID, to_dir, caller)
|
||||
return TRUE
|
||||
|
||||
/obj/structure/railing/corner/CheckExit()
|
||||
return TRUE
|
||||
|
||||
@@ -76,12 +80,20 @@
|
||||
return TRUE
|
||||
mover_dir = get_dir(loc, target)
|
||||
//Due to how the other check is done, it would always return density for ordinal directions no matter what
|
||||
if(ordinal_direction_check())
|
||||
if(ordinal_direction_check(mover_dir))
|
||||
return FALSE
|
||||
if(mover_dir != dir)
|
||||
return density
|
||||
return FALSE
|
||||
|
||||
/obj/structure/railing/CanAStarPass(ID, to_dir, caller)
|
||||
if(to_dir == dir)
|
||||
return FALSE
|
||||
if(ordinal_direction_check(to_dir))
|
||||
return FALSE
|
||||
|
||||
return TRUE
|
||||
|
||||
/obj/structure/railing/CheckExit(atom/movable/O, target)
|
||||
var/mob/living/M = O
|
||||
if(istype(O) && O.checkpass(PASSFENCE))
|
||||
@@ -100,24 +112,24 @@
|
||||
mover_dir = get_dir(O.loc, target)
|
||||
if(mover_dir == dir)
|
||||
return FALSE
|
||||
if(ordinal_direction_check())
|
||||
if(ordinal_direction_check(mover_dir))
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
// Checks if the direction the mob is trying to move towards would be blocked by a corner railing
|
||||
/obj/structure/railing/proc/ordinal_direction_check()
|
||||
/obj/structure/railing/proc/ordinal_direction_check(check_dir)
|
||||
switch(dir)
|
||||
if(5)
|
||||
if(mover_dir == 1 || mover_dir == 4)
|
||||
if(NORTHEAST)
|
||||
if(check_dir == NORTH || check_dir == EAST)
|
||||
return TRUE
|
||||
if(6)
|
||||
if(mover_dir == 2 || mover_dir == 4)
|
||||
if(SOUTHEAST)
|
||||
if(check_dir == SOUTH || check_dir == EAST)
|
||||
return TRUE
|
||||
if(9)
|
||||
if(mover_dir == 1 || mover_dir == 8)
|
||||
if(NORTHWEST)
|
||||
if(check_dir == NORTH || check_dir == WEST)
|
||||
return TRUE
|
||||
if(10)
|
||||
if(mover_dir == 2 || mover_dir == 8)
|
||||
if(SOUTHWEST)
|
||||
if(check_dir == SOUTH || check_dir == WEST)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
|
||||
Reference in New Issue
Block a user