Change key binds from array to linked list
Key bindings were stored as a fixed-size array, indexed by the input character, pointing to the extended commands. This changes that into a linked list of an intermediary struct Cmd_bind, storing the input key and the pointer to the command. This is just code cleanup for future enhancements, and should have no effect on gameplay.
This commit is contained in:
@@ -29,6 +29,14 @@
|
||||
#define ECM_EXACTMATCH 0x02 /* needs exact match of findstr */
|
||||
#define ECM_NO1CHARCMD 0x04 /* ignore commands like '?' and '#' */
|
||||
|
||||
/* a key bound to ext_func_tab */
|
||||
struct Cmd_bind {
|
||||
uchar key;
|
||||
boolean userbind; /* added by user */
|
||||
const struct ext_func_tab *cmd;
|
||||
struct Cmd_bind *next;
|
||||
};
|
||||
|
||||
struct ext_func_tab {
|
||||
uchar key;
|
||||
const char *ef_txt, *ef_desc;
|
||||
|
||||
Reference in New Issue
Block a user