Merge pull request #4399 from Citadel-Station-13/upstream-merge-33542
[MIRROR] Fixes mecha drifting.
This commit is contained in:
@@ -24,7 +24,7 @@
|
|||||||
infra_luminosity = 15 //byond implementation is bugged.
|
infra_luminosity = 15 //byond implementation is bugged.
|
||||||
force = 5
|
force = 5
|
||||||
flags_1 = HEAR_1
|
flags_1 = HEAR_1
|
||||||
var/can_move = 1
|
var/can_move = 0 //time of next allowed movement
|
||||||
var/mob/living/carbon/occupant = null
|
var/mob/living/carbon/occupant = null
|
||||||
var/step_in = 10 //make a step in step_in/10 sec.
|
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.
|
var/dir_in = 2//What direction will the mech face when entered/powered on? Defaults to South.
|
||||||
@@ -502,7 +502,7 @@
|
|||||||
return domove(direction)
|
return domove(direction)
|
||||||
|
|
||||||
/obj/mecha/proc/domove(direction)
|
/obj/mecha/proc/domove(direction)
|
||||||
if(!can_move)
|
if(can_move >= world.time)
|
||||||
return 0
|
return 0
|
||||||
if(!Process_Spacemove(direction))
|
if(!Process_Spacemove(direction))
|
||||||
return 0
|
return 0
|
||||||
@@ -520,21 +520,19 @@
|
|||||||
return 0
|
return 0
|
||||||
|
|
||||||
var/move_result = 0
|
var/move_result = 0
|
||||||
|
var/oldloc = loc
|
||||||
if(internal_damage & MECHA_INT_CONTROL_LOST)
|
if(internal_damage & MECHA_INT_CONTROL_LOST)
|
||||||
move_result = mechsteprand()
|
move_result = mechsteprand()
|
||||||
else if(dir != direction && !strafe)
|
else if(dir != direction && !strafe)
|
||||||
move_result = mechturn(direction)
|
move_result = mechturn(direction)
|
||||||
else
|
else
|
||||||
move_result = mechstep(direction)
|
move_result = mechstep(direction)
|
||||||
if(move_result)
|
if(move_result || loc != oldloc)// halfway done diagonal move still returns false
|
||||||
use_power(step_energy_drain)
|
use_power(step_energy_drain)
|
||||||
can_move = 0
|
can_move = world.time + step_in
|
||||||
spawn(step_in)
|
|
||||||
can_move = 1
|
|
||||||
return 1
|
return 1
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|
||||||
/obj/mecha/proc/mechturn(direction)
|
/obj/mecha/proc/mechturn(direction)
|
||||||
setDir(direction)
|
setDir(direction)
|
||||||
if(turnsound)
|
if(turnsound)
|
||||||
|
|||||||
Reference in New Issue
Block a user