ID:2211331
 
(See the best response by Kaiochao.)
In certain situations the player cannot move:

mob/Player
Move()
if (src.cantmove >= 1)
return 0
..()


But that makes the player unable to rotate, to change its dir. I want the player to be unable to walk, but to still be able to rotate. How do I do this?
The second argument passed to Move is the dir that the object intends to move in. Before returning early, you can simply set dir to that.
How? (I'm still learning)

mob/Player
Move()
if (src.cantmove >= 1)
dir
return 1

return 0
..()

lol like this?
In response to DarkHitz
Best response
Built-in procs like Move() are given arguments when they're called by the engine, just like how you can call your own procs with arguments. To see what arguments are passed to these procs, check the DM Reference by pressing F1. In this case, you want the "Move proc (movable atom)" page.
// For the /mob/Player type:
mob/Player

// Override the Move() proc
// (which is inherited from /atom/movable, to /mob, to /mob/Player)
// Notice how Dir is declared here as the second parameter.
// Proc parameters are like local variables that are set by the caller.
Move(NewLoc, Dir, step_x, step_y)

// If (src) can't move:
if(cantmove)
dir = Dir // Set (src's) dir to Dir.
return 0 // then stop the proc, returning 0 for failure.

// At this point, the proc hasn't been stopped.
return ..() // Call the default action and return its result.
Perfect. Thanks!