From c42771de0f8bc882670bfa8b8e698e9a02f14a0a Mon Sep 17 00:00:00 2001 From: Vallat Date: Fri, 2 Jul 2021 18:23:52 +0400 Subject: [PATCH] Fix delay (#13) and add holster hotkey (#14) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * resolve conflicts * Хоткей для кобуры --- code/datums/movement/atom_movable.dm | 1 + code/datums/movement/mob.dm | 1 + code/datums/movement/movement.dm | 3 +- code/modules/keybindings/bindings_human.dm | 41 ++++++++++++++-------- 4 files changed, 30 insertions(+), 16 deletions(-) diff --git a/code/datums/movement/atom_movable.dm b/code/datums/movement/atom_movable.dm index 685b956cde..44f352047c 100644 --- a/code/datums/movement/atom_movable.dm +++ b/code/datums/movement/atom_movable.dm @@ -8,6 +8,7 @@ // Movement relay /datum/movement_handler/move_relay/DoMove(var/direction, var/mover) + set waitfor = FALSE var/atom/movable/AM = host.loc if(!istype(AM)) return diff --git a/code/datums/movement/mob.dm b/code/datums/movement/mob.dm index 2a11de8cd9..83400adac9 100644 --- a/code/datums/movement/mob.dm +++ b/code/datums/movement/mob.dm @@ -240,6 +240,7 @@ // Finally.. the last of the mob movement junk /datum/movement_handler/mob/movement/DoMove(var/direction, var/mob/mover) + set waitfor = FALSE . = MOVEMENT_HANDLED if(mob.moving) diff --git a/code/datums/movement/movement.dm b/code/datums/movement/movement.dm index 47b53b717a..d1bf158d04 100644 --- a/code/datums/movement/movement.dm +++ b/code/datums/movement/movement.dm @@ -87,7 +87,7 @@ if(LAZYLEN(movement_handlers) && ispath(movement_handlers[1])) { \ for(var/mh in movement_handlers) var/datum/movement_handler/movement_handler = mh if(movement_handler.MayMove(mover, is_external) & MOVEMENT_STOP) - return MOVEMENT_HANDLED + return MOVEMENT_STOP . = movement_handler.DoMove(direction, mover, is_external) if(. & MOVEMENT_REMOVE) @@ -130,6 +130,7 @@ if(LAZYLEN(movement_handlers) && ispath(movement_handlers[1])) { \ . = ..() /datum/movement_handler/proc/DoMove(var/direction, var/mob/mover, var/is_external) + set waitfor = FALSE return // Asks the handlers if the mob may move, ignoring destination, if attempting a DoMove() diff --git a/code/modules/keybindings/bindings_human.dm b/code/modules/keybindings/bindings_human.dm index cfec33a158..2f64056d74 100644 --- a/code/modules/keybindings/bindings_human.dm +++ b/code/modules/keybindings/bindings_human.dm @@ -1,22 +1,33 @@ /mob/living/carbon/human/key_down(_key, client/user) -/* if(_key == "H") - var/obj/item/clothing/accessory/holster/H = null - if(istype(w_uniform, /obj/item/clothing/under)) - var/obj/item/clothing/under/S = w_uniform - if(S.accessories.len) - H = locate() in S.accessories - if (!H) + if(incapacitated()) return - if(!H.holstered) - if(!istype(get_active_hand(), /obj/item/gun)) - to_chat(usr, "You need your gun equiped to holster it.") + + var/obj/item/clothing/under/U = w_uniform + for(var/obj/S in U.accessories) + if(istype(S, /obj/item/clothing/accessory/storage/holster)) + var/datum/extension/holster/E = get_extension(S, /datum/extension/holster) + if(!E.holstered) + if(!get_active_hand()) + to_chat(usr, "You're not holding anything to holster.") + return + E.holster(get_active_hand(), src) + return + else + E.unholster(src, TRUE) + return + if(istype(belt, /obj/item/storage/belt/holster)) + var/obj/item/storage/belt/holster/B = belt + var/datum/extension/holster/E = get_extension(B, /datum/extension/holster) + if(!E.holstered) + if(!get_active_hand()) + to_chat(src, "You're not holding anything to holster.") + return + E.holster(src.get_active_hand(), src) + return + else + E.unholster(src, TRUE) return - var/obj/item/gun/W = get_active_hand() - H.holster(W, usr) - else - H.unholster(usr) -*/ if(client.keys_held["Shift"]) switch(_key) if("E") // Put held thing in belt or take out most recent thing from belt