mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
Turns movable chairs on click
This commit is contained in:
@@ -295,14 +295,19 @@
|
||||
|
||||
// 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)
|
||||
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/dy = A.y - y
|
||||
if(!dx && !dy) return
|
||||
|
||||
var/direction
|
||||
if(abs(dx) < abs(dy))
|
||||
if(dy > 0) usr.dir = NORTH
|
||||
else usr.dir = SOUTH
|
||||
if(dy > 0) direction = NORTH
|
||||
else direction = SOUTH
|
||||
else
|
||||
if(dx > 0) usr.dir = EAST
|
||||
else usr.dir = WEST
|
||||
if(dx > 0) direction = EAST
|
||||
else direction = WEST
|
||||
usr.dir = direction
|
||||
if(buckled && buckled.movable)
|
||||
buckled.dir = direction
|
||||
buckled.handle_rotation()
|
||||
Reference in New Issue
Block a user