Skip to content

Commit

Permalink
Fix delay (#13) and add holster hotkey (#14)
Browse files Browse the repository at this point in the history
* resolve conflicts

* Хоткей для кобуры
  • Loading branch information
Vallat authored and Bizzonium committed Jul 8, 2021
1 parent 1c942c3 commit edce04c
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 16 deletions.
1 change: 1 addition & 0 deletions code/datums/movement/atom_movable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions code/datums/movement/mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion code/datums/movement/movement.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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()
Expand Down
41 changes: 26 additions & 15 deletions code/modules/keybindings/bindings_human.dm
Original file line number Diff line number Diff line change
@@ -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, "<span class='warning'>You need your gun equiped to holster it.</span>")

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, "<span class='warning'>You're not holding anything to holster.</span>")
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, "<span class='warning'>You're not holding anything to holster.</span>")
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
Expand Down

0 comments on commit edce04c

Please sign in to comment.