ID:178190
 
I was wondering if there is a way to have the movement of North,South,East,West overridden for non-clients. Or if theres a way when i use the walk_to proc to have it so it only uses Northwest,Northeast,Southeast,Southwest.
DoOmBringer wrote:
I was wondering if there is a way to have the movement of North,South,East,West overridden for non-clients. Or if theres a way when i use the walk_to proc to have it so it only uses Northwest,Northeast,Southeast,Southwest.

Depending on what you're trying to accomplish, You might be able to do this by overriding Move(). Move() takes two parameters: The new turf to move to, and the direction the mob is moving in.

In theory, you should be able to check if the mob's direction is non-diagonal and adjust it.
mob
Move(newloc,newdir)
if(!newdir || newdir&(newdir-1)) // dir==0 or diagonal
return ..()
newdir=turn(newdir,45)
newloc=get_step(src,newdir)
return ..(newloc,newdir)

Now, here's the catch: This only ever turns one way. For mobs without clients, you probably want to add some kind of obstacle check in there, to find a non-obstructed direction to move in. The code for that is a little more complicated, so I'm not going to bother with it.

Lummox JR