From a4e00c5cb596038096dcd8c72e61d67fe0818f7f Mon Sep 17 00:00:00 2001 From: Tyler Trahan Date: Wed, 21 Sep 2022 04:38:03 -0600 Subject: [PATCH] Fix #9989: Zero Net Profit is neither negative nor positive (#9991) --- src/company_gui.cpp | 6 ++++-- src/lang/english.txt | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/company_gui.cpp b/src/company_gui.cpp index 8e0f1e8774..6cafcb9e1a 100644 --- a/src/company_gui.cpp +++ b/src/company_gui.cpp @@ -214,9 +214,11 @@ static void DrawCategories(const Rect &r) static void DrawPrice(Money amount, int left, int right, int top, TextColour colour) { StringID str = STR_FINANCES_NEGATIVE_INCOME; - if (amount < 0) { + if (amount == 0) { + str = STR_FINANCES_ZERO_INCOME; + } else if (amount < 0) { amount = -amount; - str++; + str = STR_FINANCES_POSITIVE_INCOME; } SetDParam(0, amount); DrawString(left, right, top, str, colour, SA_RIGHT); diff --git a/src/lang/english.txt b/src/lang/english.txt index 9dc7974c07..07e0c5a615 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -3641,6 +3641,7 @@ STR_FINANCES_SECTION_LOAN_INTEREST :{GOLD}Loan Inte STR_FINANCES_SECTION_OTHER :{GOLD}Other STR_FINANCES_NEGATIVE_INCOME :-{CURRENCY_LONG} +STR_FINANCES_ZERO_INCOME :{CURRENCY_LONG} STR_FINANCES_POSITIVE_INCOME :+{CURRENCY_LONG} STR_FINANCES_NET_PROFIT :{WHITE}Net Profit STR_FINANCES_BANK_BALANCE_TITLE :{WHITE}Bank Balance