From 43de18c3fa2d728da24d5ebdd2370a8feeec0c8c Mon Sep 17 00:00:00 2001 From: TheGamerdk <5618080+TheGamerdk@users.noreply.github.com> Date: Mon, 27 May 2024 23:05:52 +0200 Subject: [PATCH 1/5] Update headset.dm --- code/game/objects/items/devices/radio/headset.dm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/code/game/objects/items/devices/radio/headset.dm b/code/game/objects/items/devices/radio/headset.dm index 00f0ad16220c..22cbd3206898 100644 --- a/code/game/objects/items/devices/radio/headset.dm +++ b/code/game/objects/items/devices/radio/headset.dm @@ -417,8 +417,10 @@ var/obj/item/card/id/id_card = wearer.wear_id?.GetID() if(!istype(id_card)) return - if(!(id_card.rank in list(JOB_SO, JOB_XO, JOB_SQUAD_LEADER))) - to_chat(wearer, SPAN_WARNING("Only Staff Officers, Executive Officers and Squad Leaders are permitted to give medal recommendations!")) + var/paygrade = wearer.get_paygrade() + var/last_number = text2num(copytext(paygrade, length(paygrade), length(paygrade)+1)) + if(!(findtext(paygrade, "O") || last_number >= 4)) + to_chat(wearer, SPAN_WARNING("Only officers or NCO's (ME4+) can recommend medals!")) return if(add_medal_recommendation(usr)) to_chat(usr, SPAN_NOTICE("Recommendation successfully submitted.")) From 163226f10eec5d98d6fb51806c07979c2af4845e Mon Sep 17 00:00:00 2001 From: TheGamerdk <5618080+TheGamerdk@users.noreply.github.com> Date: Mon, 27 May 2024 23:10:12 +0200 Subject: [PATCH 2/5] Update headset.dm --- code/game/objects/items/devices/radio/headset.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/objects/items/devices/radio/headset.dm b/code/game/objects/items/devices/radio/headset.dm index 22cbd3206898..87b18ccfdab2 100644 --- a/code/game/objects/items/devices/radio/headset.dm +++ b/code/game/objects/items/devices/radio/headset.dm @@ -417,7 +417,7 @@ var/obj/item/card/id/id_card = wearer.wear_id?.GetID() if(!istype(id_card)) return - var/paygrade = wearer.get_paygrade() + var/paygrade = get_paygrade_id_by_name(wearer.get_paygrade(FALSE)) var/last_number = text2num(copytext(paygrade, length(paygrade), length(paygrade)+1)) if(!(findtext(paygrade, "O") || last_number >= 4)) to_chat(wearer, SPAN_WARNING("Only officers or NCO's (ME4+) can recommend medals!")) From d0825e34c07d2045958adf529b0b8a210e460398 Mon Sep 17 00:00:00 2001 From: TheGamerdk <5618080+TheGamerdk@users.noreply.github.com> Date: Mon, 27 May 2024 23:12:33 +0200 Subject: [PATCH 3/5] Update medal_awards.dm --- code/datums/medal_awards.dm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/datums/medal_awards.dm b/code/datums/medal_awards.dm index 818d623033d2..37b21bd2bb49 100644 --- a/code/datums/medal_awards.dm +++ b/code/datums/medal_awards.dm @@ -479,6 +479,10 @@ GLOBAL_LIST_INIT(xeno_medals, list(XENO_SLAUGHTER_MEDAL, XENO_RESILIENCE_MEDAL, continue recipient_ranks[recipient_name] = record.fields["rank"] possible_recipients += recipient_name + if(length(possible_recipients) == 0) + to_chat(recommendation_giver, SPAN_WARNING("It's not possible to give medals when the ship is empty. Tough luck, partner...")) + return FALSE + var/chosen_recipient = tgui_input_list(recommendation_giver, "Who do you want to recommend a medal for?", "Medal Recommendation", possible_recipients) if(!chosen_recipient) return FALSE From 3bce3048a8ace5eca0714e6592301f5230c5d4fc Mon Sep 17 00:00:00 2001 From: TheGamerdk <5618080+TheGamerdk@users.noreply.github.com> Date: Tue, 28 May 2024 20:45:28 +0200 Subject: [PATCH 4/5] Update headset.dm --- code/game/objects/items/devices/radio/headset.dm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/code/game/objects/items/devices/radio/headset.dm b/code/game/objects/items/devices/radio/headset.dm index 87b18ccfdab2..05f3749db071 100644 --- a/code/game/objects/items/devices/radio/headset.dm +++ b/code/game/objects/items/devices/radio/headset.dm @@ -417,9 +417,13 @@ var/obj/item/card/id/id_card = wearer.wear_id?.GetID() if(!istype(id_card)) return - var/paygrade = get_paygrade_id_by_name(wearer.get_paygrade(FALSE)) - var/last_number = text2num(copytext(paygrade, length(paygrade), length(paygrade)+1)) - if(!(findtext(paygrade, "O") || last_number >= 4)) + + var/datum/paygrade/paygrade_actual = GLOB.paygrades[id_card.paygrade] + if(!paygrade_actual) + return + if(!istype(paygrade_actual, /datum/paygrade/marine)) //We only want marines to be able to recommend for medals + return + if(ranking < 3) //E1 starts at 0, so anyone above Corporal (ranking = 3) can recommend for medals to_chat(wearer, SPAN_WARNING("Only officers or NCO's (ME4+) can recommend medals!")) return if(add_medal_recommendation(usr)) From 5d75a515639cd87e0575ba957f0925bce7450aea Mon Sep 17 00:00:00 2001 From: TheGamerdk <5618080+TheGamerdk@users.noreply.github.com> Date: Tue, 28 May 2024 20:53:32 +0200 Subject: [PATCH 5/5] oops --- code/game/objects/items/devices/radio/headset.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/objects/items/devices/radio/headset.dm b/code/game/objects/items/devices/radio/headset.dm index 05f3749db071..52f8bd76e894 100644 --- a/code/game/objects/items/devices/radio/headset.dm +++ b/code/game/objects/items/devices/radio/headset.dm @@ -423,7 +423,7 @@ return if(!istype(paygrade_actual, /datum/paygrade/marine)) //We only want marines to be able to recommend for medals return - if(ranking < 3) //E1 starts at 0, so anyone above Corporal (ranking = 3) can recommend for medals + if(paygrade_actual.ranking < 3) //E1 starts at 0, so anyone above Corporal (ranking = 3) can recommend for medals to_chat(wearer, SPAN_WARNING("Only officers or NCO's (ME4+) can recommend medals!")) return if(add_medal_recommendation(usr))