From 402cfca7e4589116e1fe6d78b13492b31421ee08 Mon Sep 17 00:00:00 2001 From: TyroneSWG <5607938+TyroneSWG@users.noreply.github.com> Date: Tue, 17 Nov 2020 05:51:43 -0600 Subject: [PATCH] Console error when paying Hero of Tatooine farmer. Probably could be done better. --- .../quest_hero_of_tatooine_farmer.java | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/sku.0/sys.server/compiled/game/script/conversation/quest_hero_of_tatooine_farmer.java b/sku.0/sys.server/compiled/game/script/conversation/quest_hero_of_tatooine_farmer.java index a99c6cf00..50ac95fa9 100755 --- a/sku.0/sys.server/compiled/game/script/conversation/quest_hero_of_tatooine_farmer.java +++ b/sku.0/sys.server/compiled/game/script/conversation/quest_hero_of_tatooine_farmer.java @@ -90,21 +90,13 @@ public class quest_hero_of_tatooine_farmer extends script.base_script } public void quest_hero_of_tatooine_farmer_action_paid_ransom(obj_id player, obj_id npc) throws InterruptedException { - if (!money.hasFunds(player, money.MT_CASH, 10000)) + int ransom = 10000; + int credits = getBankBalance(player); + if (credits < 10000) { return; } - int bank_before = getBankBalance(player); - if (money.requestPayment(player, "hero_of_tatooine", 10000, null, null, false)) - { - int bank_after = getBankBalance(player); - int bank_delta = bank_before - bank_after; - if (bank_delta > 10000) - { - bank_delta = 10000; - } - money.covertDeposit(player, bank_delta, "noHandler", null); - } + money.transferBankCreditsTo(player, npc, ransom, "noHandler", "noHandler", null); } public void quest_hero_of_tatooine_farmer_action_will_help(obj_id player, obj_id npc) throws InterruptedException {