Skip to content

Commit

Permalink
You can no longer bypass skill checks on pill bottles (#4097)
Browse files Browse the repository at this point in the history
# About the pull request

When it got passed to attack_hand() from unarmed_attack() in click() it
would not check the skillcheck as it calls attack_hand() on the pill
rather than through the pill bottle which was allowing a bypass for the
skillcheck for pill bottles. This *feels* like the wrong way to do it as
like OOP so I'm happy to do it in a different way.

# Explain why it's good for the game

Bug bad


# Testing Photographs and Procedure
<details>
<summary>Screenshots & Videos</summary>

Put screenshots and videos here with an empty line between the
screenshots and the `<details>` tags.

</details>


# Changelog

:cl: Morrow
fix: You can no longer bypass skill checks on pill bottles
/:cl:
  • Loading branch information
morrowwolf authored Aug 4, 2023
1 parent 50e83da commit e1a97c4
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions code/game/objects/items/storage/firstaid.dm
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,22 @@
..()
update_icon()

/obj/item/storage/pill_bottle/attack_hand(mob/user, mods)
if(loc != user)
return ..()

if(!mods || !mods["alt"])
return ..()

if(!ishuman(user))
return ..()

if(skilllock && !skillcheck(user, SKILL_MEDICAL, SKILL_MEDICAL_MEDIC))
error_idlock(user)
return FALSE

return ..()

/obj/item/storage/pill_bottle/proc/error_idlock(mob/user)
to_chat(user, SPAN_WARNING("It must have some kind of ID lock..."))

Expand Down

0 comments on commit e1a97c4

Please sign in to comment.