mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-26 22:50:26 +01:00
Refactors the keys_held rolling buffer (#53773)
* rolling key rip * category * comment * oops
This commit is contained in:
@@ -192,3 +192,13 @@
|
||||
/// rate limiting for the crew manifest
|
||||
var/crew_manifest_delay
|
||||
|
||||
/// A buffer of currently held keys.
|
||||
var/list/keys_held = list()
|
||||
/*
|
||||
** These next two vars are to apply movement for keypresses and releases made while move delayed.
|
||||
** Because discarding that input makes the game less responsive.
|
||||
*/
|
||||
/// On next move, add this dir to the move that would otherwise be done
|
||||
var/next_move_dir_add
|
||||
/// On next move, subtract this dir from the move that would otherwise be done
|
||||
var/next_move_dir_sub
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* Manually clears any held keys, in case due to lag or other undefined behavior a key gets stuck.
|
||||
*
|
||||
* Hardcoded to the ESC key.
|
||||
*/
|
||||
/client/verb/reset_held_keys()
|
||||
set name = "Reset Held Keys"
|
||||
set hidden = TRUE
|
||||
|
||||
for(var/key in keys_held)
|
||||
keyUp(key)
|
||||
Reference in New Issue
Block a user