From a543d557b931f2b6c75c436701d8b42c833f6fcf Mon Sep 17 00:00:00 2001 From: GinjaNinja32 Date: Mon, 24 Nov 2014 18:56:41 +0000 Subject: [PATCH] Fix sub-1 thaler piles being invisible, disallow subdivision below 0.01 --- code/modules/economy/ATM.dm | 3 +++ code/modules/economy/cash.dm | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/code/modules/economy/ATM.dm b/code/modules/economy/ATM.dm index 05828ed7dd..1274abff64 100644 --- a/code/modules/economy/ATM.dm +++ b/code/modules/economy/ATM.dm @@ -217,6 +217,7 @@ log transactions if("transfer") if(authenticated_account) var/transfer_amount = text2num(href_list["funds_amount"]) + transfer_amount = round(transfer_amount, 0.01) if(transfer_amount <= 0) alert("That is not a valid amount.") else if(transfer_amount <= authenticated_account.money) @@ -302,6 +303,7 @@ log transactions previous_account_number = tried_account_num if("e_withdrawal") var/amount = max(text2num(href_list["funds_amount"]),0) + amount = round(amount, 0.01) if(amount <= 0) alert("That is not a valid amount.") else if(authenticated_account && amount > 0) @@ -327,6 +329,7 @@ log transactions usr << "\icon[src]You don't have enough funds to do that!" if("withdrawal") var/amount = max(text2num(href_list["funds_amount"]),0) + amount = round(amount, 0.01) if(amount <= 0) alert("That is not a valid amount.") else if(authenticated_account && amount > 0) diff --git a/code/modules/economy/cash.dm b/code/modules/economy/cash.dm index e996a6c708..862708742c 100644 --- a/code/modules/economy/cash.dm +++ b/code/modules/economy/cash.dm @@ -78,6 +78,13 @@ M.Turn(pick(-45, -27.5, 0, 0, 0, 0, 0, 0, 0, 27.5, 45)) banknote.transform = M src.overlays += banknote + if(num == 0) // Less than one thaler, let's just make it look like 1 for ease + var/image/banknote = image('icons/obj/items.dmi', "spacecash1") + var/matrix/M = matrix() + M.Translate(rand(-6, 6), rand(-4, 8)) + M.Turn(pick(-45, -27.5, 0, 0, 0, 0, 0, 0, 0, 27.5, 45)) + banknote.transform = M + src.overlays += banknote src.desc = "They are worth [worth] Thalers." /obj/item/weapon/spacecash/bundle/attack_self()