Window Booping Fix (#2691)

A minor issue that's annoyed me for a long time;
This PR adds ON_BORDER support for attack animations and atom facing, causing you to face and strike in the correct direction when dealing with border objects on the same tile as you. Previously these things would fail and do no animation/facing change

Afaik, border objects really just means single pane windows and windoors right now.
This commit is contained in:
NanakoAC
2017-06-15 12:31:20 +03:00
committed by skull132
parent 6f3fa4eba9
commit a8b9ae0022
3 changed files with 51 additions and 3 deletions
+8 -1
View File
@@ -144,7 +144,12 @@ note dizziness decrements automatically in the mob's Life() proc.
var/pixel_x_diff = 0
var/pixel_y_diff = 0
var/direction = get_dir(src, A)
var/direction
if (loc == A.loc)
if (A.flags & ON_BORDER)
direction = A.dir
else
direction = get_dir(src, A)
switch(direction)
if(NORTH)
pixel_y_diff = 8
@@ -166,6 +171,8 @@ note dizziness decrements automatically in the mob's Life() proc.
if(SOUTHWEST)
pixel_x_diff = -8
pixel_y_diff = -8
else
return 0//No valid direction
animate(src, pixel_x = pixel_x + pixel_x_diff, pixel_y = pixel_y + pixel_y_diff, time = 2)
animate(pixel_x = pixel_x - pixel_x_diff, pixel_y = pixel_y - pixel_y_diff, time = 2)