From 534d728c50df4770ac03592b2450ef5c18ba6e57 Mon Sep 17 00:00:00 2001 From: TheGamerdk <5618080+TheGamerdk@users.noreply.github.com> Date: Fri, 14 Jun 2024 13:16:44 +0200 Subject: [PATCH] Fixes medals being spawned on the square you start writing it on (#6451) # About the pull request Solution: Get the turf when you finish writing the medal, instead of when you start # Testing Photographs and Procedure
Screenshots & Videos Put screenshots and videos here with an empty line between the screenshots and the `
` tags.
# Changelog :cl: fix: Fixes small issue allowing medals to teleport /:cl: --- code/datums/medal_awards.dm | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/code/datums/medal_awards.dm b/code/datums/medal_awards.dm index aaabbe2ab555..fcaef38c884c 100644 --- a/code/datums/medal_awards.dm +++ b/code/datums/medal_awards.dm @@ -131,16 +131,17 @@ GLOBAL_LIST_INIT(human_medals, list(MARINE_CONDUCT_MEDAL, MARINE_BRONZE_HEART_ME // Create an actual medal item if(medal_location) + var/turf/turf_location = get_turf(medal_location) var/obj/item/clothing/accessory/medal/medal switch(medal_type) if(MARINE_CONDUCT_MEDAL) - medal = new /obj/item/clothing/accessory/medal/bronze/conduct(medal_location) + medal = new /obj/item/clothing/accessory/medal/bronze/conduct(turf_location) if(MARINE_BRONZE_HEART_MEDAL) - medal = new /obj/item/clothing/accessory/medal/bronze/heart(medal_location) + medal = new /obj/item/clothing/accessory/medal/bronze/heart(turf_location) if(MARINE_VALOR_MEDAL) - medal = new /obj/item/clothing/accessory/medal/silver/valor(medal_location) + medal = new /obj/item/clothing/accessory/medal/silver/valor(turf_location) if(MARINE_HEROISM_MEDAL) - medal = new /obj/item/clothing/accessory/medal/gold/heroism(medal_location) + medal = new /obj/item/clothing/accessory/medal/gold/heroism(turf_location) else return FALSE medal.recipient_name = chosen_recipient @@ -223,16 +224,17 @@ GLOBAL_LIST_INIT(human_medals, list(MARINE_CONDUCT_MEDAL, MARINE_BRONZE_HEART_ME // Create an actual medal item if(medal_location) + var/turf/turf_location = get_turf(medal_location) var/obj/item/clothing/accessory/medal/medal switch(medal_type) if(MARINE_CONDUCT_MEDAL) - medal = new /obj/item/clothing/accessory/medal/bronze/conduct(medal_location) + medal = new /obj/item/clothing/accessory/medal/bronze/conduct(turf_location) if(MARINE_BRONZE_HEART_MEDAL) - medal = new /obj/item/clothing/accessory/medal/bronze/heart(medal_location) + medal = new /obj/item/clothing/accessory/medal/bronze/heart(turf_location) if(MARINE_VALOR_MEDAL) - medal = new /obj/item/clothing/accessory/medal/silver/valor(medal_location) + medal = new /obj/item/clothing/accessory/medal/silver/valor(turf_location) if(MARINE_HEROISM_MEDAL) - medal = new /obj/item/clothing/accessory/medal/gold/heroism(medal_location) + medal = new /obj/item/clothing/accessory/medal/gold/heroism(turf_location) else return FALSE medal.recipient_name = chosen_recipient @@ -606,7 +608,7 @@ GLOBAL_DATUM_INIT(ic_medals_panel, /datum/ic_medal_panel, new) switch(action) if("grant_new_medal") - if(give_medal_award(get_turf(actual_loc))) + if(give_medal_award(actual_loc)) actual_loc.visible_message(SPAN_NOTICE("[actual_loc] prints a medal.")) . = TRUE @@ -631,7 +633,7 @@ GLOBAL_DATUM_INIT(ic_medals_panel, /datum/ic_medal_panel, new) if(confirm_choice != "Yes") return - if(give_medal_award_prefilled(get_turf(actual_loc), user, recommendation.recipient_name, recommendation.recipient_rank, recommendation.recipient_ckey, medal_citation, medal_type, recommendation.recommended_by_ckey, recommendation.recommended_by_name)) + if(give_medal_award_prefilled(actual_loc, user, recommendation.recipient_name, recommendation.recipient_rank, recommendation.recipient_ckey, medal_citation, medal_type, recommendation.recommended_by_ckey, recommendation.recommended_by_name)) GLOB.medal_recommendations -= recommendation qdel(recommendation) user.visible_message(SPAN_NOTICE("[actual_loc] prints a medal."))