ID:263606
 
Code:
turf
stairs3
icon = 'tiles.dmi'
icon_state = "stairs3"
name = "Stairs"
density = 0
Entered(Mob/M)
usr.loc=locate(53,3,1)


Problem description:

How do I prevent moving NPC's from going though?
Don't use usr in procs. I'll break, like you've just seen. Instead, find a variable that points to the mob you want.
You already have, by using usr in Entered(). There's an argument for a reason, use it.

In addition, the way you've set up stairs is, quite frankly, going to be stupidly tedious to change, if ever you change the map. Use a more flexible system:

proc/getturf(atom/A) //return the turf that ultimately contains (or is) A, or null if not applicable
if(!istype(A)) return
while(A && !isarea(A) && !isturf(A))
A = A.loc
if(isturf(A))
return A

turf
stairs
var/destination = ""
Entered(mob/M)
var/turf/T = getturf(locate(destination))
if(istype(M) && T)
M.loc = T


Now, you can place stairs on the map, right-click on them, and change their tags and destination. So, for a pair of staircases, set the first one's tag to "stair1" and destination to "stair2", and the second one's tag to "stair2" and destination to "stair1".

You'll avoid a lot of pain later by doing this.