Merge pull request #4399 from Citadel-Station-13/upstream-merge-33542

[MIRROR] Fixes mecha drifting.
This commit is contained in:
LetterJay
2017-12-18 15:19:13 -06:00
committed by GitHub

View File

@@ -24,7 +24,7 @@
infra_luminosity = 15 //byond implementation is bugged.
force = 5
flags_1 = HEAR_1
var/can_move = 1
var/can_move = 0 //time of next allowed movement
var/mob/living/carbon/occupant = null
var/step_in = 10 //make a step in step_in/10 sec.
var/dir_in = 2//What direction will the mech face when entered/powered on? Defaults to South.
@@ -502,7 +502,7 @@
return domove(direction)
/obj/mecha/proc/domove(direction)
if(!can_move)
if(can_move >= world.time)
return 0
if(!Process_Spacemove(direction))
return 0
@@ -520,21 +520,19 @@
return 0
var/move_result = 0
var/oldloc = loc
if(internal_damage & MECHA_INT_CONTROL_LOST)
move_result = mechsteprand()
else if(dir != direction && !strafe)
move_result = mechturn(direction)
else
move_result = mechstep(direction)
if(move_result)
if(move_result || loc != oldloc)// halfway done diagonal move still returns false
use_power(step_energy_drain)
can_move = 0
spawn(step_in)
can_move = 1
can_move = world.time + step_in
return 1
return 0
/obj/mecha/proc/mechturn(direction)
setDir(direction)
if(turnsound)