From d93f5b7c2e31b26f557f3fc858ccd4bb2f52747e Mon Sep 17 00:00:00 2001 From: ArcaneMusic <41715314+ArcaneMusic@users.noreply.github.com> Date: Wed, 22 Jul 2020 19:16:59 -0400 Subject: [PATCH] Fixes completing a bounty and not getting paid. (#52363) * Fixes completing a bounty and not getting paid. * Oh right that thing that I didn't commit * Cleans up the parenthesis in the proc. * Linter BEGONE * Apply suggestions from code review Co-authored-by: Rohesie Co-authored-by: Rohesie --- code/game/machinery/civilian_bountys.dm | 7 ++++++- code/modules/cargo/bounties/assistant.dm | 13 ------------- code/modules/events/pirates.dm | 4 +++- 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/code/game/machinery/civilian_bountys.dm b/code/game/machinery/civilian_bountys.dm index 15476f1975b..060f9591fcb 100644 --- a/code/game/machinery/civilian_bountys.dm +++ b/code/game/machinery/civilian_bountys.dm @@ -78,6 +78,11 @@ return FALSE var/datum/bounty/curr_bounty = inserted_scan_id.registered_account.civilian_bounty var/active_stack = 0 + var/datum/bank_account/dept_account = SSeconomy.get_dep_account(inserted_scan_id.registered_account.account_job.paycheck_department) + if(!dept_account?.has_money(curr_bounty.reward)) + playsound(loc, 'sound/machines/synth_no.ogg', 50 , TRUE) + stop_sending("Not enough funds to submit bounty at this time, please try again later.") + return FALSE for(var/atom/movable/AM in get_turf(pad)) if(AM == pad) continue @@ -92,7 +97,7 @@ stop_sending() if(curr_bounty.can_claim()) //Pay for the bounty with the ID's department funds. - inserted_scan_id.registered_account.transfer_money(SSeconomy.get_dep_account(inserted_scan_id.registered_account.account_job.paycheck_department), curr_bounty.reward) + inserted_scan_id.registered_account.transfer_money(dept_account, curr_bounty.reward) status_report += "Bounty Completed! [curr_bounty.reward] credits have been paid out. " inserted_scan_id.registered_account.reset_bounty() pad.visible_message("[pad] activates!") diff --git a/code/modules/cargo/bounties/assistant.dm b/code/modules/cargo/bounties/assistant.dm index 4d1e527d3c9..354f9d18954 100644 --- a/code/modules/cargo/bounties/assistant.dm +++ b/code/modules/cargo/bounties/assistant.dm @@ -153,19 +153,6 @@ required_count = 8 wanted_types = list(/obj/item/kirbyplants) -/datum/bounty/item/assistant/earmuffs - name = "Earmuffs" - description = "Central Command is getting tired of your station's messages. They've ordered that you ship some earmuffs to lessen the annoyance." - reward = 1000 - wanted_types = list(/obj/item/clothing/ears/earmuffs) - -/datum/bounty/item/assistant/handcuffs - name = "Handcuffs" - description = "A large influx of escaped convicts have arrived at Central Command. Now is the perfect time to ship out spare handcuffs (or restraints)." - reward = 1000 - required_count = 5 - wanted_types = list(/obj/item/restraints/handcuffs) - /datum/bounty/item/assistant/monkey_cubes name = "Monkey Cubes" description = "Due to a recent genetics accident, Central Command is in serious need of monkeys. Your mission is to ship monkey cubes." diff --git a/code/modules/events/pirates.dm b/code/modules/events/pirates.dm index c14d49afa64..eaf85ac8db5 100644 --- a/code/modules/events/pirates.dm +++ b/code/modules/events/pirates.dm @@ -386,11 +386,13 @@ pad.icon_state = pad.warmup_state sending_timer = addtimer(CALLBACK(src,.proc/send),warmup_time, TIMER_STOPPABLE) -/obj/machinery/computer/piratepad_control/proc/stop_sending() +/obj/machinery/computer/piratepad_control/proc/stop_sending(custom_report) if(!sending) return sending = FALSE status_report = "Ready for delivery." + if(custom_report) + status_report = custom_report pad.icon_state = pad.idle_state deltimer(sending_timer)