Skip to content

Commit

Permalink
Fixes for medals. (#5901)
Browse files Browse the repository at this point in the history
# About the pull request

By design, you cannot wear uniform/armour with somebody else's medal.
Fine, but let it be checked upon trying to don the bemedalled object
yourself, not upon simply picking it up from the ground. It is
frustrating to constantly drop medals when trying to rearmour your
patients after revival/surgery.
(Ceterum censeo, letting doctors call themselves surgeons adds nothing
but an excuse to shirk pharmacy duties and to pretend to have priority
for deployment. But a bug is a bug.)

# Explain why it's good for the game

Is fixes.

# Changelog

:cl:
fix: Picking up clothes/armour with somebody else's medal attached no
longer makes the medal fall off (trying to wear them still does).
fix: Doctors calling themselves surgeons now properly get playtime
medals.
fix: Playtime medals now use assignments instead of backend paygrade
codes (e.g. "Awarded to Squad Leader John Doe" instead of "Awarded to
ME5 John Doe").
/:cl:
  • Loading branch information
Segrain authored Mar 12, 2024
1 parent 4822bbd commit 1c2ad76
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions code/modules/clothing/under/ties.dm
Original file line number Diff line number Diff line change
Expand Up @@ -154,18 +154,18 @@
/obj/item/clothing/accessory/medal/on_attached(obj/item/clothing/S, mob/living/user, silent)
. = ..()
if(.)
RegisterSignal(S, COMSIG_ITEM_PICKUP, PROC_REF(remove_medal))
RegisterSignal(S, COMSIG_ITEM_EQUIPPED, PROC_REF(remove_medal))

/obj/item/clothing/accessory/medal/proc/remove_medal(obj/item/clothing/C, mob/user)
/obj/item/clothing/accessory/medal/proc/remove_medal(obj/item/clothing/C, mob/user, slot)
SIGNAL_HANDLER
if(user.real_name != recipient_name)
if(user.real_name != recipient_name && (slot == WEAR_BODY || slot == WEAR_JACKET))
C.remove_accessory(user, src)
user.drop_held_item(src)

/obj/item/clothing/accessory/medal/on_removed(mob/living/user, obj/item/clothing/C)
. = ..()
if(.)
UnregisterSignal(C, COMSIG_ITEM_PICKUP)
UnregisterSignal(C, COMSIG_ITEM_EQUIPPED)

/obj/item/clothing/accessory/medal/attack(mob/living/carbon/human/H, mob/living/carbon/human/user)
if(!(istype(H) && istype(user)))
Expand Down
4 changes: 2 additions & 2 deletions code/modules/gear_presets/_select_equipment.dm
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@
qdel(R)

if(flags & EQUIPMENT_PRESET_MARINE)
var/playtime = get_job_playtime(new_human.client, assignment)
var/playtime = get_job_playtime(new_human.client, rank)
var/medal_type

switch(playtime)
Expand All @@ -220,7 +220,7 @@
if(medal_type)
var/obj/item/clothing/accessory/medal/medal = new medal_type()
medal.recipient_name = new_human.real_name
medal.recipient_rank = current_rank
medal.recipient_rank = assignment

if(new_human.wear_suit && new_human.wear_suit.can_attach_accessory(medal))
new_human.wear_suit.attach_accessory(new_human, medal, TRUE)
Expand Down

0 comments on commit 1c2ad76

Please sign in to comment.