From ac36433b5256948a1e4c94e8d04b184a58a70628 Mon Sep 17 00:00:00 2001 From: rubidium Date: Tue, 15 Sep 2009 17:23:24 +0000 Subject: [PATCH] (svn r17546) -Fix (r9617): sign extending of profit calculation didn't work --- src/economy.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/economy.cpp b/src/economy.cpp index 340b6fdb75..6436f0fc04 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