Skip to content

Commit

Permalink
Fix CQC slapper (#28342)
Browse files Browse the repository at this point in the history
* fix slapper drop

* Apply code review

Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
Signed-off-by: kyunkyunkyun <120701975+kyunkyunkyun@users.noreply.github.com>

---------

Signed-off-by: kyunkyunkyun <120701975+kyunkyunkyun@users.noreply.github.com>
Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
  • Loading branch information
kyunkyunkyun and DGamerL authored Feb 12, 2025
1 parent c11e1c9 commit e6c6888
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions code/game/objects/items/hand_item.dm
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,14 @@
AddComponent(/datum/component/parry, _stamina_constant = 2, _stamina_coefficient = 0.5, _parryable_attack_types = NON_PROJECTILE_ATTACKS, _parry_cooldown = (4 / 3) SECONDS) //75% uptime
if(isliving(loc))
var/mob/owner = loc
RegisterSignal(owner, COMSIG_MOB_WILLINGLY_DROP, TYPE_PROC_REF(/datum, signal_qdel), override = TRUE)
RegisterSignal(owner, COMSIG_MOB_WEAPON_APPEARS, TYPE_PROC_REF(/datum, signal_qdel), override = TRUE)
RegisterSignal(owner, COMSIG_MOB_WILLINGLY_DROP, PROC_REF(dropkey), override = TRUE)
RegisterSignal(owner, COMSIG_MOB_WEAPON_APPEARS, PROC_REF(dropkey), override = TRUE)
return ..()

/obj/item/slapper/parry/proc/dropkey(mob/user)
if(user?.get_active_hand() == src)
qdel(src)

/obj/item/slapper/parry/Destroy()
if(isliving(loc))
var/mob/owner = loc
Expand Down

0 comments on commit e6c6888

Please sign in to comment.