From 41f359db835fe4d31cadd6e487ffe9ada6606a7f Mon Sep 17 00:00:00 2001 From: kevinz000 <2003111+kevinz000@users.noreply.github.com> Date: Sat, 11 Apr 2020 05:11:42 -0700 Subject: [PATCH] fixes --- code/__HELPERS/do_after.dm | 4 ++-- code/modules/keybindings/bindings_living.dm | 21 +++++++++++++++++++-- code/modules/keybindings/bindings_mob.dm | 15 --------------- 3 files changed, 21 insertions(+), 19 deletions(-) diff --git a/code/__HELPERS/do_after.dm b/code/__HELPERS/do_after.dm index f9d54dd676..054a20e29b 100644 --- a/code/__HELPERS/do_after.dm +++ b/code/__HELPERS/do_after.dm @@ -15,8 +15,8 @@ * - mob/living/mob_redirect - advanced option: If this is specified, movement and mobility/combat flag checks will use this instead of user. Progressbars will also go to this. * - obj/item/tool - The tool we're using. See do_after flags for details. */ -#define INVOKE_CALLBACK cb_return = extra_checks?.Invoke(user, delay, target, world.time - starttime, do_after_flags, required_mobility_flags, required_combat_flags, mob_redirect, stage, initiailly_held_item, tool) -#define CHECK_FLAG_FAILURE ((required_mobility_flags || required_combat_flags) && (!living_user || !CHECK_ALL_MOBILITY(living_user, required_mobility_flags) || !CHECK_ALL_BITFIELDS(living_user.combat_flags, required_combat_flags))) +#define INVOKE_CALLBACK cb_return = extra_checks?.Invoke(user, delay, target, world.time - starttime, do_after_flags, required_mobility_flags, required_combat_flags, mob_redirect, stage, initially_held_item, tool) +#define CHECK_FLAG_FAILURE ((required_mobility_flags || required_combat_flags) && (!living_user || !CHECK_ALL_MOBILITY(living_user, required_mobility_flags) || !CHECK_MULTIPLE_BITFIELDS(living_user.combat_flags, required_combat_flags))) #define TIMELEFT (world.time - starttime) /proc/do_after_advanced(atom/user, delay, atom/target, do_after_flags, datum/callback/extra_checks, required_mobility_flags, required_combat_flags, mob/living/mob_redirect, obj/item/tool) // CHECK AND SET VARIABLES diff --git a/code/modules/keybindings/bindings_living.dm b/code/modules/keybindings/bindings_living.dm index ec6c5dd539..dd10c71b89 100644 --- a/code/modules/keybindings/bindings_living.dm +++ b/code/modules/keybindings/bindings_living.dm @@ -22,6 +22,23 @@ if ("V") lay_down() return + if("Insert") + if(client.keys_held["Ctrl"]) + keybind_toggle_active_blocking() + return + else + keybind_parry() + return + if("G") + keybind_parry() + return + if("F") + keybind_start_active_blocking() + return ..() - - return ..() \ No newline at end of file +/mob/living/key_up(_key, client/user) + switch(_key) + if("F") + keybind_stop_active_blocking() + return + return ..() diff --git a/code/modules/keybindings/bindings_mob.dm b/code/modules/keybindings/bindings_mob.dm index 95a883dda7..fa0691fb5e 100644 --- a/code/modules/keybindings/bindings_mob.dm +++ b/code/modules/keybindings/bindings_mob.dm @@ -10,18 +10,6 @@ else stop_pulling() return - if("Insert") - if(client.keys_held["Ctrl"]) - keybind_toggle_active_blocking() - return - else - keybind_parry() - return - if("G") - keybind_parry() - return - if("F") - keybind_start_active_blocking() if("X", "Northeast") // Northeast is Page-up swap_hand() return @@ -97,7 +85,4 @@ if("Alt") toggle_move_intent() return - if("F") - keybind_stop_active_blocking() - return return ..()