Merge pull request #4933 from Citadel-Station-13/upstream-merge-34573
[MIRROR] Fixes the diagonal sliding
This commit is contained in:
@@ -157,36 +157,47 @@
|
||||
. = ..()
|
||||
else //Diagonal move, split it into cardinal moves
|
||||
moving_diagonally = FIRST_DIAG_STEP
|
||||
if (direct & 1)
|
||||
if (direct & 4)
|
||||
var/first_step_dir
|
||||
if (direct & NORTH)
|
||||
if (direct & EAST)
|
||||
if (step(src, NORTH))
|
||||
first_step_dir = NORTH
|
||||
moving_diagonally = SECOND_DIAG_STEP
|
||||
. = step(src, EAST)
|
||||
else if (step(src, EAST))
|
||||
first_step_dir = EAST
|
||||
moving_diagonally = SECOND_DIAG_STEP
|
||||
. = step(src, NORTH)
|
||||
else if (direct & 8)
|
||||
else if (direct & WEST)
|
||||
if (step(src, NORTH))
|
||||
first_step_dir = NORTH
|
||||
moving_diagonally = SECOND_DIAG_STEP
|
||||
. = step(src, WEST)
|
||||
else if (step(src, WEST))
|
||||
first_step_dir = WEST
|
||||
moving_diagonally = SECOND_DIAG_STEP
|
||||
. = step(src, NORTH)
|
||||
else if (direct & 2)
|
||||
if (direct & 4)
|
||||
else if (direct & SOUTH)
|
||||
if (direct & EAST)
|
||||
if (step(src, SOUTH))
|
||||
first_step_dir = SOUTH
|
||||
moving_diagonally = SECOND_DIAG_STEP
|
||||
. = step(src, EAST)
|
||||
else if (step(src, EAST))
|
||||
first_step_dir = EAST
|
||||
moving_diagonally = SECOND_DIAG_STEP
|
||||
. = step(src, SOUTH)
|
||||
else if (direct & 8)
|
||||
else if (direct & WEST)
|
||||
if (step(src, SOUTH))
|
||||
first_step_dir = SOUTH
|
||||
moving_diagonally = SECOND_DIAG_STEP
|
||||
. = step(src, WEST)
|
||||
else if (step(src, WEST))
|
||||
first_step_dir = WEST
|
||||
moving_diagonally = SECOND_DIAG_STEP
|
||||
. = step(src, SOUTH)
|
||||
if(!. && moving_diagonally == SECOND_DIAG_STEP)
|
||||
setDir(first_step_dir)
|
||||
moving_diagonally = 0
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user