Makes editing movements delay configs have an effect again (#32530)

This commit is contained in:
Jordan Brown
2017-11-09 12:04:48 -05:00
committed by duncathan salt
parent d3df913402
commit 45c5e63206
3 changed files with 23 additions and 10 deletions

View File

@@ -163,9 +163,20 @@ CONFIG_DEF(flag/ooc_during_round)
CONFIG_DEF(flag/emojis)
CONFIG_DEF(number/run_delay) //Used for modifying movement speed for mobs.
var/static/value_cache = 0
CONFIG_TWEAK(number/run_delay/ValidateAndSet())
. = ..()
if(.)
value_cache = value
CONFIG_DEF(number/walk_delay)
var/static/value_cache = 0
CONFIG_TWEAK(number/walk_delay/ValidateAndSet())
. = ..()
if(.)
value_cache = value
CONFIG_DEF(number/human_delay) //Mob specific modifiers. NOTE: These will affect different mob types in different ways
CONFIG_DEF(number/robot_delay)

View File

@@ -15,18 +15,20 @@
delivery_icon = "deliverybox"
anchorable = FALSE
var/move_speed_multiplier = 1
var/move_delay = 0
var/move_delay = FALSE
var/egged = 0
/obj/structure/closet/cardboard/relaymove(mob/user, direction)
if(opened || move_delay || user.stat || user.IsStun() || user.IsKnockdown() || user.IsUnconscious() || !isturf(loc) || !has_gravity(loc))
return
move_delay = 1
move_delay = TRUE
if(step(src, direction))
spawn(CONFIG_GET(number/walk_delay) * move_speed_multiplier)
move_delay = 0
addtimer(CALLBACK(src, .proc/ResetMoveDelay), CONFIG_GET(number/walk_delay) * move_speed_multiplier)
else
move_delay = 0
ResetMoveDelay()
/obj/structure/closet/cardboard/proc/ResetMoveDelay()
move_delay = FALSE
/obj/structure/closet/cardboard/open()
if(opened || !can_open())

View File

@@ -479,21 +479,21 @@
if(isopenturf(loc) && !is_flying())
var/turf/open/T = loc
. += T.slowdown
var/static/config_run_delay
var/static/config_walk_delay
var/static/datum/config_entry/number/run_delay/config_run_delay
var/static/datum/config_entry/number/walk_delay/config_walk_delay
if(isnull(config_run_delay))
config_run_delay = CONFIG_GET(number/run_delay)
config_walk_delay = CONFIG_GET(number/walk_delay)
if(ignorewalk)
. += config_run_delay
. += config_run_delay.value_cache
else
switch(m_intent)
if(MOVE_INTENT_RUN)
if(drowsyness > 0)
. += 6
. += config_run_delay
. += config_run_delay.value_cache
if(MOVE_INTENT_WALK)
. += config_walk_delay
. += config_walk_delay.value_cache
/mob/living/proc/makeTrail(turf/target_turf, turf/start, direction)
if(!has_gravity())