prevent SSinput from constantly reporting null movements (#59558) (#6208)

Just prevents SSinput from constantly calling Move() every tick for every user even when no actual movement is requested.

Only done rudimentary testing - straightforward and we've been using this for months on CM13 but without diagonal movement.

I asked the original SSinput author back then which said that it was likely an oversight. I believe moving the diagonal movement direction buffer reset to keyLoop instead of Move() also makes sense as it is actually relevant to SSinput and not client actions as a whole (eg. if you call built-in movement verbs)

Co-authored-by: fira <loyauflorian@gmail.com>
This commit is contained in:
SkyratBot
2021-06-10 09:14:50 +12:00
committed by GitHub
co-authored by fira
parent 9e3c9f26c2
commit 2ff93b78d0
2 changed files with 5 additions and 3 deletions
@@ -7,8 +7,13 @@
movement_dir = movement_dir | user.movement_keys[_key]
if(user.next_move_dir_add)
movement_dir |= user.next_move_dir_add
user.next_move_dir_add = 0
if(user.next_move_dir_sub)
movement_dir &= ~user.next_move_dir_sub
user.next_move_dir_sub = 0
if(!movement_dir)
return
// Sanity checks in case you hold left and right and up to make sure you only go up
if((movement_dir & NORTH) && (movement_dir & SOUTH))
movement_dir &= ~(NORTH|SOUTH)
-3
View File
@@ -69,9 +69,6 @@
/client/Move(new_loc, direct)
if(world.time < move_delay) //do not move anything ahead of this check please
return FALSE
else
next_move_dir_add = 0
next_move_dir_sub = 0
var/old_move_delay = move_delay
move_delay = world.time + world.tick_lag //this is here because Move() can now be called mutiple times per tick
if(!mob || !mob.loc)