Skip to content

Commit

Permalink
Reduce the move delay buffer to 1 tick (ParadiseSS13#24615)
Browse files Browse the repository at this point in the history
* Reduce the move delay buffer to 1 tick

* Fix linter
  • Loading branch information
dj-34 authored Mar 15, 2024
1 parent b2e3ec4 commit 8353257
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions code/modules/mob/mob_movement.dm
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@
mob.control_object.forceMove(get_step(mob.control_object, direct))
return

#define MOVEMENT_DELAY_BUFFER 0.75
#define MOVEMENT_DELAY_BUFFER_DELTA 1.25
#define CONFUSION_LIGHT_COEFFICIENT 0.15
#define CONFUSION_HEAVY_COEFFICIENT 0.075
#define CONFUSION_MAX 80 SECONDS
Expand All @@ -54,9 +52,10 @@
/client/Move(n, direct)
if(world.time < move_delay)
return
else
input_data.desired_move_dir_add = NONE
input_data.desired_move_dir_sub = NONE

input_data.desired_move_dir_add = NONE
input_data.desired_move_dir_sub = NONE

var/old_move_delay = move_delay
move_delay = world.time + world.tick_lag //this is here because Move() can now be called multiple times per tick
if(!mob || !mob.loc)
Expand Down Expand Up @@ -131,10 +130,8 @@
M.stop_pulling()


//We are now going to move
moving = 1
var/delay = mob.movement_delay()
if(old_move_delay + (delay * MOVEMENT_DELAY_BUFFER_DELTA) + MOVEMENT_DELAY_BUFFER > world.time)
if(old_move_delay + world.tick_lag > world.time)
move_delay = old_move_delay
else
move_delay = world.time
Expand Down Expand Up @@ -185,7 +182,6 @@
if(prev_pulling_loc && mob.pulling?.face_while_pulling && (mob.pulling.loc != prev_pulling_loc))
mob.setDir(get_dir(mob, mob.pulling)) // Face welding tanks and stuff when pulling

moving = 0
if(mob && . && mob.throwing)
mob.throwing.finalize(FALSE)

Expand Down Expand Up @@ -512,6 +508,3 @@
hud_used.move_intent.icon_state = icon_toggle
for(var/atom/movable/screen/mov_intent/selector in hud_used.static_inventory)
selector.update_icon()

#undef MOVEMENT_DELAY_BUFFER
#undef MOVEMENT_DELAY_BUFFER_DELTA

0 comments on commit 8353257

Please sign in to comment.