mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-14 08:34:16 +01:00
Retrofit TG pathfinder with upstream improvements (#25583)
* Retrofit TG pathfinder with upstream improvements * i know how things work * don't use HAS_TRAIT for things that aren't traits * unique filenames * i'm just a goofy lil moron * use new block syntax * apparently values don't need clamping with new block syntax? * silence invalid JPS dest runtime * fix runtime passing ID instead of access list
This commit is contained in:
committed by
GitHub
parent
62dc3d57dd
commit
ca93f6bc77
@@ -419,11 +419,10 @@
|
||||
else
|
||||
return 0
|
||||
|
||||
/obj/structure/girder/CanPathfindPass(obj/item/card/id/ID, dir, caller, no_id = FALSE)
|
||||
/obj/structure/girder/CanPathfindPass(to_dir, datum/can_pass_info/pass_info)
|
||||
. = !density
|
||||
if(ismovable(caller))
|
||||
var/atom/movable/mover = caller
|
||||
. = . || mover.checkpass(PASSGRILLE)
|
||||
if(pass_info.is_movable)
|
||||
. = . || pass_info.pass_flags & PASSGRILLE
|
||||
|
||||
/obj/structure/girder/deconstruct(disassembled = TRUE)
|
||||
if(!(flags & NODECONSTRUCT))
|
||||
|
||||
@@ -126,11 +126,10 @@
|
||||
if(isprojectile(mover))
|
||||
return (prob(30) || !density)
|
||||
|
||||
/obj/structure/grille/CanPathfindPass(obj/item/card/id/ID, dir, caller, no_id = FALSE)
|
||||
/obj/structure/grille/CanPathfindPass(to_dir, datum/can_pass_info/pass_info)
|
||||
. = !density
|
||||
if(ismovable(caller))
|
||||
var/atom/movable/mover = caller
|
||||
. = . || mover.checkpass(PASSGRILLE)
|
||||
if(pass_info.is_movable)
|
||||
. = . || pass_info.pass_flags & PASSGRILLE
|
||||
|
||||
/obj/structure/grille/attackby(obj/item/I, mob/user, params)
|
||||
user.changeNext_move(CLICK_CD_MELEE)
|
||||
|
||||
@@ -308,11 +308,10 @@
|
||||
|
||||
return FALSE
|
||||
|
||||
/obj/structure/m_tray/CanPathfindPass(obj/item/card/id/ID, dir, caller, no_id = FALSE)
|
||||
/obj/structure/m_tray/CanPathfindPass(to_dir, datum/can_pass_info/pass_info)
|
||||
. = !density
|
||||
if(ismovable(caller))
|
||||
var/atom/movable/mover = caller
|
||||
. = . || mover.checkpass(PASSTABLE)
|
||||
if(pass_info.is_movable)
|
||||
. = . || pass_info.pass_flags & PASSTABLE
|
||||
|
||||
/obj/structure/m_tray/Process_Spacemove(movement_dir)
|
||||
return TRUE
|
||||
|
||||
@@ -76,17 +76,16 @@
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/structure/plasticflaps/CanPathfindPass(obj/item/card/id/ID, to_dir, caller, no_id = FALSE)
|
||||
if(isliving(caller))
|
||||
if(isbot(caller) || isdrone(caller))
|
||||
return TRUE
|
||||
/obj/structure/plasticflaps/CanPathfindPass(to_dir, datum/can_pass_info/pass_info)
|
||||
if(pass_info.is_bot || pass_info.is_drone)
|
||||
return TRUE
|
||||
|
||||
if(!pass_info.can_ventcrawl && pass_info.mob_size != MOB_SIZE_TINY)
|
||||
return FALSE
|
||||
|
||||
if(pass_info.pulling_info)
|
||||
return CanPathfindPass(to_dir, pass_info.pulling_info)
|
||||
|
||||
var/mob/living/M = caller
|
||||
if(!M.ventcrawler && M.mob_size != MOB_SIZE_TINY)
|
||||
return FALSE
|
||||
var/atom/movable/M = caller
|
||||
if(M && M.pulling)
|
||||
return CanPathfindPass(ID, to_dir, M.pulling)
|
||||
return TRUE //diseases, stings, etc can pass
|
||||
|
||||
/obj/structure/plasticflaps/deconstruct(disassembled = TRUE)
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
/obj/structure/railing/corner/CanPass()
|
||||
return TRUE
|
||||
|
||||
/obj/structure/railing/corner/CanPathfindPass(obj/item/card/id/ID, to_dir, caller, no_id = FALSE)
|
||||
/obj/structure/railing/corner/CanPathfindPass(to_dir, datum/can_pass_info/pass_info)
|
||||
return TRUE
|
||||
|
||||
/obj/structure/railing/corner/CheckExit()
|
||||
@@ -93,7 +93,7 @@
|
||||
/obj/structure/railing/cap/CanPass()
|
||||
return TRUE
|
||||
|
||||
/obj/structure/railing/cap/CanPathfindPass(obj/item/card/id/ID, to_dir, caller, no_id = FALSE)
|
||||
/obj/structure/railing/cap/CanPathfindPass(to_dir, datum/can_pass_info/pass_info)
|
||||
return TRUE
|
||||
|
||||
/obj/structure/railing/cap/CheckExit()
|
||||
@@ -118,7 +118,7 @@
|
||||
return density
|
||||
return FALSE
|
||||
|
||||
/obj/structure/railing/CanPathfindPass(obj/item/card/id/ID, to_dir, caller, no_id = FALSE)
|
||||
/obj/structure/railing/CanPathfindPass(to_dir, datum/can_pass_info/pass_info)
|
||||
if(to_dir == dir)
|
||||
return FALSE
|
||||
if(ordinal_direction_check(to_dir))
|
||||
|
||||
@@ -150,11 +150,10 @@
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/obj/structure/table/CanPathfindPass(obj/item/card/id/ID, dir, caller, no_id = FALSE)
|
||||
/obj/structure/table/CanPathfindPass(to_dir, datum/can_pass_info/pass_info)
|
||||
. = !density
|
||||
if(ismovable(caller))
|
||||
var/atom/movable/mover = caller
|
||||
. = . || mover.checkpass(PASSTABLE)
|
||||
if(pass_info.is_movable)
|
||||
. = . || pass_info.pass_flags & PASSTABLE
|
||||
|
||||
/**
|
||||
* Determines whether a projectile crossing our turf should be stopped.
|
||||
@@ -887,11 +886,10 @@
|
||||
else
|
||||
return 0
|
||||
|
||||
/obj/structure/rack/CanPathfindPass(obj/item/card/id/ID, dir, caller, no_id = FALSE)
|
||||
/obj/structure/rack/CanPathfindPass(to_dir, datum/can_pass_info/pass_info)
|
||||
. = !density
|
||||
if(ismovable(caller))
|
||||
var/atom/movable/mover = caller
|
||||
. = . || mover.checkpass(PASSTABLE)
|
||||
if(pass_info.is_movable)
|
||||
. = . || pass_info.pass_flags & PASSTABLE
|
||||
|
||||
/obj/structure/rack/MouseDrop_T(obj/O, mob/user)
|
||||
if((!isitem(O) || user.get_active_hand() != O))
|
||||
|
||||
@@ -137,13 +137,13 @@
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/structure/window/CanPathfindPass(obj/item/card/id/ID, to_dir, atom/movable/caller, no_id = FALSE)
|
||||
/obj/structure/window/CanPathfindPass(to_dir, datum/can_pass_info/pass_info)
|
||||
if(!density)
|
||||
return 1
|
||||
return TRUE
|
||||
if((dir == FULLTILE_WINDOW_DIR) || (dir & to_dir) || fulltile)
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
/obj/structure/window/attack_tk(mob/user)
|
||||
user.changeNext_move(CLICK_CD_MELEE)
|
||||
|
||||
Reference in New Issue
Block a user