From ac622f5760ddb1b7368c0a6de94a4a71771d2c76 Mon Sep 17 00:00:00 2001 From: Allen Webster Date: Wed, 8 Nov 2017 20:25:54 -0500 Subject: [PATCH] Fixed crash bug with --- 4coder_API/types.h | 6 +++++- 4ed_command.cpp | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/4coder_API/types.h b/4coder_API/types.h index ae606e45..aa0e3404 100644 --- a/4coder_API/types.h +++ b/4coder_API/types.h @@ -36,7 +36,11 @@ ENUM(int32_t, Key_Modifier_Index){ MDFR_CONTROL_INDEX, MDFR_ALT_INDEX, MDFR_COMMAND_INDEX, - MDFR_CAPS_INDEX, + + /* DOC(MDFR_INDEX_BINDABLE_COUNT is used to specify the number of supported modifiers that can be used in key bindings.) */ + MDFR_INDEX_BINDABLE_COUNT, + + MDFR_CAPS_INDEX = MDFR_INDEX_BINDABLE_COUNT, MDFR_HOLD_INDEX, /* DOC(MDFR_INDEX_COUNT is used to specify the number of modifiers supported.) */ diff --git a/4ed_command.cpp b/4ed_command.cpp index 21fb99b5..8963b860 100644 --- a/4ed_command.cpp +++ b/4ed_command.cpp @@ -26,7 +26,7 @@ static Command_Binding null_command_binding = {0}; struct Command_Map{ i32 parent; - Command_Binding vanilla_keyboard_default[8]; + Command_Binding vanilla_keyboard_default[1 << MDFR_INDEX_BINDABLE_COUNT]; Command_Binding *commands; i32 count, max; void *real_beginning;