Skip to content

Commit

Permalink
Added passflag checking for A*.
Browse files Browse the repository at this point in the history
  • Loading branch information
Menshin committed Jan 30, 2016
1 parent ad5172a commit ca679f5
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 3 deletions.
2 changes: 2 additions & 0 deletions code/__DEFINES/is_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@

#define isbot(A) (istype(A, /mob/living/simple_animal/bot))

#define ismovableatom(A) (istype(A, /atom/movable))

// ASSEMBLY HELPERS

#define isassembly(O) (istype(O, /obj/item/device/assembly))
Expand Down
5 changes: 5 additions & 0 deletions code/game/gamemodes/blob/theblob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@
return 1
return 0

/obj/effect/blob/CanAStarPass(ID, dir, caller)
. = 0
if(ismovableatom(caller))
var/atom/movable/mover = caller
. = . || mover.checkpass(PASSBLOB)

/obj/effect/blob/proc/check_health(cause)
health = Clamp(health, 0, maxhealth)
Expand Down
7 changes: 6 additions & 1 deletion code/game/objects/structures/girders.dm
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@
else
..()


/obj/structure/girder/CanPass(atom/movable/mover, turf/target, height=0)
if(height==0)
return 1
Expand All @@ -257,6 +256,12 @@
else
return 0

/obj/structure/girder/CanAStarPass(ID, dir, caller)
. = !density
if(ismovableatom(caller))
var/atom/movable/mover = caller
. = . || mover.checkpass(PASSGRILLE)

/obj/structure/girder/blob_act()
if(prob(40))
qdel(src)
Expand Down
6 changes: 6 additions & 0 deletions code/game/objects/structures/grille.dm
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@
else
return !density

/obj/structure/grille/CanAStarPass(ID, dir, caller)
. = !density
if(ismovableatom(caller))
var/atom/movable/mover = caller
. = . || mover.checkpass(PASSGRILLE)

/obj/structure/grille/bullet_act(var/obj/item/projectile/Proj)
if(!Proj)
return
Expand Down
6 changes: 6 additions & 0 deletions code/game/objects/structures/morgue.dm
Original file line number Diff line number Diff line change
Expand Up @@ -271,3 +271,9 @@ var/global/list/crematoriums = new/list()
return 1
else
return 0

/obj/structure/tray/m_tray/CanAStarPass(ID, dir, caller)
. = !density
if(ismovableatom(caller))
var/atom/movable/mover = caller
. = . || mover.checkpass(PASSTABLE)
12 changes: 12 additions & 0 deletions code/game/objects/structures/tables_racks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@
else
return !density

/obj/structure/table/CanAStarPass(ID, dir, caller)
. = !density
if(ismovableatom(caller))
var/atom/movable/mover = caller
. = . || mover.checkpass(PASSTABLE)

/obj/structure/table/MouseDrop_T(atom/movable/O, mob/user)
..()
if(ismob(O) && user == O && ishuman(user))
Expand Down Expand Up @@ -449,6 +455,12 @@
else
return 0

/obj/structure/rack/CanAStarPass(ID, dir, caller)
. = !density
if(ismovableatom(caller))
var/atom/movable/mover = caller
. = . || mover.checkpass(PASSTABLE)

/obj/structure/rack/MouseDrop_T(obj/O, mob/user)
if ((!( istype(O, /obj/item/weapon) ) || user.get_active_hand() != O))
return
Expand Down
4 changes: 2 additions & 2 deletions code/orphaned procs/AStar.dm
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ Actual Adjacent procs :
T = get_step(src,dir)
if(simulated_only && !istype(T))
continue
if(!T.density && !LinkBlockedWithAccess(T,ID, caller))
if(!T.density && !LinkBlockedWithAccess(T,caller, ID))
L.Add(T)
return L

Expand All @@ -177,7 +177,7 @@ Actual Adjacent procs :
L.Add(T)
return L

/turf/proc/LinkBlockedWithAccess(turf/T, ID, caller)
/turf/proc/LinkBlockedWithAccess(turf/T, caller, ID)
var/adir = get_dir(src, T)
var/rdir = get_dir(T, src)

Expand Down

0 comments on commit ca679f5

Please sign in to comment.