From 6004245af2ddbcfa33babc8a4f85ca2cdeb1a7d2 Mon Sep 17 00:00:00 2001
From: Erika Fox <94164348+Bjarl@users.noreply.github.com>
Date: Wed, 2 Oct 2024 18:29:59 -0400
Subject: [PATCH] actually fix defibs
---
code/game/objects/items/defib.dm | 7 +++----
code/modules/surgery/revival.dm | 2 +-
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/code/game/objects/items/defib.dm b/code/game/objects/items/defib.dm
index 517bc9922786..640b4e4a6a0a 100644
--- a/code/game/objects/items/defib.dm
+++ b/code/game/objects/items/defib.dm
@@ -302,7 +302,6 @@
var/obj/item/defibrillator/defib
var/req_defib = TRUE
var/combat = FALSE //If it penetrates armor and gives additional functionality
- var/wielded = FALSE // track wielded status on item
/obj/item/shockpaddles/ComponentInitialize()
. = ..()
@@ -367,10 +366,10 @@
update_appearance()
/obj/item/shockpaddles/update_icon_state()
- icon_state = "[base_icon_state][wielded]"
+ icon_state = "[base_icon_state][HAS_TRAIT(src, TRAIT_WIELDED)]"
item_state = icon_state
if(cooldown)
- icon_state = "[base_icon_state][wielded]_cooldown"
+ icon_state = "[base_icon_state][HAS_TRAIT(src, TRAIT_WIELDED)]_cooldown"
return ..()
/obj/item/shockpaddles/dropped(mob/user)
@@ -397,7 +396,7 @@
user.visible_message("[defib] beeps: Unit is unpowered.")
playsound(src, 'sound/machines/defib_failed.ogg', 50, FALSE)
return
- if(!wielded)
+ if(!HAS_TRAIT(src, TRAIT_WIELDED))
if(iscyborg(user))
to_chat(user, "You must activate the paddles in your active module before you can use them on someone!")
else
diff --git a/code/modules/surgery/revival.dm b/code/modules/surgery/revival.dm
index 13e4e3b784c6..7aef39fb5451 100644
--- a/code/modules/surgery/revival.dm
+++ b/code/modules/surgery/revival.dm
@@ -42,7 +42,7 @@
. = TRUE
if(istype(tool, /obj/item/shockpaddles))
var/obj/item/shockpaddles/S = tool
- if((S.req_defib && !S.defib.powered) || !S.wielded || S.cooldown || S.busy)
+ if((S.req_defib && !S.defib.powered) || !HAS_TRAIT(S, TRAIT_WIELDED) || S.cooldown || S.busy)
to_chat(user, "You need to wield both paddles, and [S.defib] must be powered!")
return FALSE
if(istype(tool, /obj/item/melee/baton))