summaryrefslogtreecommitdiff
path: root/src/economy.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-09-15 17:23:24 +0000
committerrubidium <rubidium@openttd.org>2009-09-15 17:23:24 +0000
commitac36433b5256948a1e4c94e8d04b184a58a70628 (patch)
tree0b3047468a64572ed0397638680b1d9a1dca83ee /src/economy.cpp
parentf2487381ce266241952b3e0d8f796740d405f0ea (diff)
downloadopenttd-ac36433b5256948a1e4c94e8d04b184a58a70628.tar.xz
(svn r17546) -Fix (r9617): sign extending of profit calculation didn't work
Diffstat (limited to 'src/economy.cpp')
-rw-r--r--src/economy.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/economy.cpp b/src/economy.cpp
index 340b6fdb7..6436f0fc0 100644
--- a/src/economy.cpp
+++ b/src/economy.cpp
@@ -815,7 +815,7 @@ Money GetTransportedGoodsIncome(uint num_pieces, uint dist, byte transit_days, C
int result = GB(callback, 0, 14);
/* Simulate a 15 bit signed value */
- if (HasBit(callback, 14)) result = 0x4000 - result;
+ if (HasBit(callback, 14)) result -= 0x4000;
/* "The result should be a signed multiplier that gets multiplied
* by the amount of cargo moved and the price factor, then gets