Turns movable chairs on click

This commit is contained in:
Hubblenaut
2014-07-02 22:33:33 +02:00
parent dd76b9f2ca
commit 0abfad0bbb

View File

@@ -295,14 +295,19 @@
// Simple helper to face what you clicked on, in case it should be needed in more than one place // Simple helper to face what you clicked on, in case it should be needed in more than one place
/mob/proc/face_atom(var/atom/A) /mob/proc/face_atom(var/atom/A)
if( stat || buckled || !A || !x || !y || !A.x || !A.y ) return if( stat || (buckled && !buckled.movable) || !A || !x || !y || !A.x || !A.y ) return
var/dx = A.x - x var/dx = A.x - x
var/dy = A.y - y var/dy = A.y - y
if(!dx && !dy) return if(!dx && !dy) return
var/direction
if(abs(dx) < abs(dy)) if(abs(dx) < abs(dy))
if(dy > 0) usr.dir = NORTH if(dy > 0) direction = NORTH
else usr.dir = SOUTH else direction = SOUTH
else else
if(dx > 0) usr.dir = EAST if(dx > 0) direction = EAST
else usr.dir = WEST else direction = WEST
usr.dir = direction
if(buckled && buckled.movable)
buckled.dir = direction
buckled.handle_rotation()