ID:176267
 
Gah. Okay, client.West() calls something to make a mob turn left, THEN walk in its new direction. The problem? It turns, but it won't walk. The area it's trying to move is nondense, but..hm..I'll paste the problem area here..
client.West()
for(var/mob/player/head/M in world)
M.dir = turn(M.dir,90)
walk(M,M.dir,3)
Hanns wrote:
Gah. Okay, client.West() calls something to make a mob turn left, THEN walk in its new direction. The problem? It turns, but it won't walk. The area it's trying to move is nondense, but..hm..I'll paste the problem area here..
client.West()
for(var/mob/player/head/M in world)
M.dir = turn(M.dir,90)
walk(M,M.dir,3)

Time for an odd question: Why are you looping through every mob in the world? Presumably you'd want to just control the player's mob, which would be src.mob or usr (which is valid here since West() is actually a verb).

Beyond that I'm really not sure what the problem is. Are you sure a mob of this type actually exists in the world?

Lummox JR
In response to Lummox JR
Yeah. And, um, about the looping..There's only one. It's just my weird coding style.

[EDIT] Oh, yeah, and it isn't a client mob..I should probably do that, though.
In response to Hanns
Hanns wrote:
Yeah. And, um, about the looping..There's only one. It's just my weird coding style.

Never a good idea to do that; locate() would work better, but even that's a lot less efficient than just keeping track of the mob in some other way.

Lummox JR
In response to Lummox JR
Okay. I shifted the mob's key to the user's key, so it's now the client's mob. I altered it to work with it, too. Same problems, though.
client.West()
usr.dir = turn(usr.dir,90)
walk(usr,usr.dir,3)

Still turns, but doesn't move.
In response to Hanns
Oops..I found it. Turns out I forgot to put ..() in the Move() proc..

[EDIT] Thanks Crispy, Cinnom.