Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: fix some give runtimes #4528

Merged
merged 1 commit into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions code/modules/mob/living/carbon/give.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/mob/living/carbon/verb/give(var/mob/living/carbon/target in oview(1))
/mob/living/carbon/verb/give(mob/living/carbon/target in oview(1))
set category = "IC"
set name = "Give"

Expand Down Expand Up @@ -125,8 +125,8 @@
..()
holder.mouse_pointer_icon = 'icons/misc/mouse_icons/give_item.dmi'
to_chat(holder, span_info("You can now left click on someone to give them your held item."))
RegisterSignal(holder.mob.get_active_hand(), list(COMSIG_PARENT_QDELETING, COMSIG_ITEM_EQUIPPED, COMSIG_ITEM_DROPPED), /datum/proc/signal_qdel)

RegisterSignal(holder.mob.get_active_hand(), list(COMSIG_PARENT_QDELETING, COMSIG_ITEM_EQUIPPED, COMSIG_ITEM_DROPPED), PROC_REF(signal_qdel))
RegisterSignal(holder.mob, COMSIG_MOB_SWAP_HANDS, PROC_REF(signal_qdel))

/datum/click_intercept/give/Destroy(force = FALSE, ...)
holder.mouse_pointer_icon = initial(holder.mouse_pointer_icon)
Expand Down Expand Up @@ -188,10 +188,9 @@
giver.apply_status_effect(STATUS_EFFECT_OFFERING_ITEM, receiver_UID, item_UID)
add_overlay(icon(I.icon, I.icon_state, SOUTH))
add_overlay("alert_flash")
RegisterSignal(I, list(COMSIG_ITEM_EQUIPPED, COMSIG_ITEM_DROPPED), PROC_REF(cancel_give))
// If either of these atoms are deleted, we need to cancel everything. Also saves having to do null checks before interacting with these atoms.
RegisterSignal(I, COMSIG_PARENT_QDELETING, /datum/proc/signal_qdel)
RegisterSignal(giver, COMSIG_PARENT_QDELETING, /datum/proc/signal_qdel)
RegisterSignal(I, list(COMSIG_PARENT_QDELETING, COMSIG_ITEM_EQUIPPED, COMSIG_ITEM_DROPPED), PROC_REF(cancel_give))
RegisterSignal(giver, list(COMSIG_PARENT_QDELETING, COMSIG_MOB_SWAP_HANDS), PROC_REF(cancel_give))


/obj/screen/alert/take_item/Destroy()
Expand Down
9 changes: 2 additions & 7 deletions code/modules/mob/living/carbon/inventory.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,8 @@
return FALSE

hand = !hand

if(hud_used && hud_used.inv_slots[slot_l_hand] && hud_used.inv_slots[slot_r_hand])
var/obj/screen/inventory/hand/H
H = hud_used.inv_slots[slot_l_hand]
H.update_icon()
H = hud_used.inv_slots[slot_r_hand]
H.update_icon()
update_hands_HUD()
SEND_SIGNAL(src, COMSIG_MOB_SWAP_HANDS)


/mob/living/carbon/activate_hand(selhand) //0 or "r" or "right" for right hand; 1 or "l" or "left" for left hand.
Expand Down
Loading