mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-26 06:29:23 +01:00
prevent SSinput from constantly reporting null movements (#59558)
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)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user