This commit is contained in:
Drsmail
2025-02-17 17:38:06 +00:00
committed by GitHub
parent 8c35714802
commit b9bd42ff21
+27
View File
@@ -165,6 +165,14 @@
remove_paddles(user)
update_icon(UPDATE_OVERLAYS)
/obj/item/defibrillator/on_mob_move(dir, mob/user)
if(paddles_on_defib)
return
if(paddles.loc != user)
remove_paddles(paddles.loc)
/obj/item/defibrillator/item_action_slot_check(slot, mob/user)
if(slot == ITEM_SLOT_BACK)
return TRUE
@@ -371,6 +379,25 @@
defib.update_icon(UPDATE_OVERLAYS)
update_icon(UPDATE_ICON_STATE)
/obj/item/shockpaddles/on_give(mob/living/carbon/giver, mob/living/carbon/receiver)
// This should be True, because action give calls drop() before this proc
if(defib.paddles_on_defib)
//Detach the paddles into the user's hands
defib.paddles.forceMove(receiver)
defib.paddles_on_defib = FALSE
else if(receiver.is_in_active_hand(defib.paddles))
//Remove from their hands and back onto the defib unit
defib.remove_paddles(receiver)
defib.update_icon(UPDATE_OVERLAYS)
update_icon(UPDATE_ICON_STATE)
// We call this to check if the receiver is outside the defib range
// Otherwise, it can be placed anywhere on the map
on_mob_move(null, receiver)
/obj/item/shockpaddles/on_mob_move(dir, mob/user)
if(defib)
if(!isturf(user.loc))