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

actually fix defibs #3471

Merged
merged 1 commit into from
Oct 2, 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
7 changes: 3 additions & 4 deletions code/game/objects/items/defib.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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()
. = ..()
Expand Down Expand Up @@ -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)
Expand All @@ -397,7 +396,7 @@
user.visible_message("<span class='notice'>[defib] beeps: Unit is unpowered.</span>")
playsound(src, 'sound/machines/defib_failed.ogg', 50, FALSE)
return
if(!wielded)
if(!HAS_TRAIT(src, TRAIT_WIELDED))
if(iscyborg(user))
to_chat(user, "<span class='warning'>You must activate the paddles in your active module before you can use them on someone!</span>")
else
Expand Down
2 changes: 1 addition & 1 deletion code/modules/surgery/revival.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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, "<span class='warning'>You need to wield both paddles, and [S.defib] must be powered!</span>")
return FALSE
if(istype(tool, /obj/item/melee/baton))
Expand Down
Loading