mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-06-30 17:10:24 +01:00
(svn r17546) -Fix (r9617): sign extending of profit calculation didn't work
This commit is contained in:
parent
f2487381ce
commit
ac36433b52
@ -815,7 +815,7 @@ Money GetTransportedGoodsIncome(uint num_pieces, uint dist, byte transit_days, C
|
|||||||
int result = GB(callback, 0, 14);
|
int result = GB(callback, 0, 14);
|
||||||
|
|
||||||
/* Simulate a 15 bit signed value */
|
/* 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
|
/* "The result should be a signed multiplier that gets multiplied
|
||||||
* by the amount of cargo moved and the price factor, then gets
|
* by the amount of cargo moved and the price factor, then gets
|
||||||
|
Loading…
Reference in New Issue
Block a user