diff options
author | rubidium <rubidium@openttd.org> | 2008-12-26 23:37:53 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-12-26 23:37:53 +0000 |
commit | b8d82cc28c8f133008fe3794b7b52b43593aa209 (patch) | |
tree | 9bc4506fe7be3558245a82cad6dad205fbc2c23e /src/misc_gui.cpp | |
parent | f4d10ec033e7af54eedc9f19afccfff447e7c312 (diff) | |
download | openttd-b8d82cc28c8f133008fe3794b7b52b43593aa209.tar.xz |
(svn r14752) -Fix [FS#2438]: revenue when clearing land would show up in red in the land info window as negative cost.
Diffstat (limited to 'src/misc_gui.cpp')
-rw-r--r-- | src/misc_gui.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp index ac1f24d16..7d67b078f 100644 --- a/src/misc_gui.cpp +++ b/src/misc_gui.cpp @@ -156,11 +156,17 @@ public: line_nr++; } - /* Cost to clear */ + /* Cost to clear/revenue when cleared */ StringID str = STR_01A4_COST_TO_CLEAR_N_A; if (CmdSucceeded(costclear)) { - SetDParam(0, costclear.GetCost()); - str = STR_01A5_COST_TO_CLEAR; + Money cost = costclear.GetCost(); + if (cost < 0) { + cost = -cost; // Negate negative cost to a positive revenue + str = STR_REVENUE_WHEN_CLEARED; + } else { + str = STR_01A5_COST_TO_CLEAR; + } + SetDParam(0, cost); } GetString(this->landinfo_data[line_nr], str, lastof(this->landinfo_data[line_nr])); line_nr++; |