/turf/Enter(atom/movable/mover as mob|obj, atom/forget as mob|obj|turf|area)
if (!mover)
return 1
// First, make sure it can leave its square
if(isturf(mover.loc))
// Nothing but border objects stop you from leaving a tile, only one loop is needed
for(var/obj/obstacle in mover.loc)
if(ismob(mover) && mover:client)
world << "origin: checking exit of mob [obstacle]"
if(!obstacle.CheckExit(mover, src) && obstacle != mover && obstacle != forget)
if(ismob(mover) && mover:client)
world << "Origin: We are bumping into [obstacle]"
mover.Bump(obstacle, 1)
return 0
var/list/large_dense = list()
//Next, check objects to block entry that are on the border
for(var/atom/movable/border_obstacle in src)
if(border_obstacle.flags&ON_BORDER)
if(ismob(mover) && mover:client)
world << "Target(border): checking exit of [border_obstacle]"
if(!border_obstacle.CanPass(mover, mover.loc) && (forget != border_obstacle))
if(ismob(mover) && mover:client)
world << "Target(border): We are bumping into [border_obstacle]"
mover.Bump(border_obstacle, 1)
return 0
else
large_dense += border_obstacle
//Then, check the turf itself
if (!src.CanPass(mover, src))
mover.Bump(src, 1)
return 0
//Finally, check objects/mobs to block entry that are not on the border
for(var/atom/movable/obstacle in large_dense)
if(ismob(mover) && mover:client)
world << "target(large_dense): [mover] checking [obstacle]"
if(!obstacle.CanPass(mover, mover.loc) && (forget != obstacle))
if(ismob(mover) && mover:client)
world << "target(large_dense): checking: We are bumping into [obstacle]"
mover.Bump(obstacle, 1)
return 0
return 1 //Nothing found to block so return success!
Problem description:
Have an interesting bug resulting in a certain mob type being able to phase through border objects. Example of the bug in action: http://a.pomf.se/yclmqq.webm
I've been trying to figure out what's going on and the only thing I can think of is for this mob child only is atom/Enter being called when it tries to move past one of these directional windows and if a mob is on the otherside it will swap places due to code in Bump. Thing is I don't call the super in turf/Enter, only return 1 or 0 as seen above.
Best solution is probably to transfer most of this logic into Move().