diff options
author | smatz <smatz@openttd.org> | 2008-02-20 17:06:58 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2008-02-20 17:06:58 +0000 |
commit | a190606f2e7567898b71c663989cd47bed7eab91 (patch) | |
tree | a0fa27513f3db7b29c7cab369a56629ef6c457ce /src/newgrf_engine.cpp | |
parent | e95a85315ce8aeb40b1dd28cf6f5607032be9a7b (diff) | |
download | openttd-a190606f2e7567898b71c663989cd47bed7eab91.tar.xz |
(svn r12197) -Fix [FS#1788](r12134): show correct last year profit when the train had negative income
-Codechange: use GetDisplayProfitThisYear() to convert vehicle profit to readable form
Diffstat (limited to 'src/newgrf_engine.cpp')
-rw-r--r-- | src/newgrf_engine.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/newgrf_engine.cpp b/src/newgrf_engine.cpp index e35d25456..60c8a49b1 100644 --- a/src/newgrf_engine.cpp +++ b/src/newgrf_engine.cpp @@ -694,14 +694,14 @@ static uint32 VehicleGetVariable(const ResolverObject *object, byte variable, by case 0x4F: return GB(v->reliability, 8, 8); case 0x50: return v->reliability_spd_dec; case 0x51: return GB(v->reliability_spd_dec, 8, 8); - case 0x52: return ClampToI32(v->profit_this_year >> 8); - case 0x53: return GB(ClampToI32(v->profit_this_year >> 8), 8, 24); - case 0x54: return GB(ClampToI32(v->profit_this_year >> 8), 16, 16); - case 0x55: return GB(ClampToI32(v->profit_this_year >> 8), 24, 8); - case 0x56: return ClampToI32(v->profit_last_year >> 8); - case 0x57: return GB(ClampToI32(v->profit_last_year >> 8), 8, 24); - case 0x58: return GB(ClampToI32(v->profit_last_year >> 8), 16, 16); - case 0x59: return GB(ClampToI32(v->profit_last_year >> 8), 24, 8); + case 0x52: return ClampToI32(v->GetDisplayProfitThisYear()); + case 0x53: return GB(ClampToI32(v->GetDisplayProfitThisYear()), 8, 24); + case 0x54: return GB(ClampToI32(v->GetDisplayProfitThisYear()), 16, 16); + case 0x55: return GB(ClampToI32(v->GetDisplayProfitThisYear()), 24, 8); + case 0x56: return ClampToI32(v->GetDisplayProfitLastYear()); + case 0x57: return GB(ClampToI32(v->GetDisplayProfitLastYear()), 8, 24); + case 0x58: return GB(ClampToI32(v->GetDisplayProfitLastYear()), 16, 16); + case 0x59: return GB(ClampToI32(v->GetDisplayProfitLastYear()), 24, 8); case 0x5A: return v->Next() == NULL ? INVALID_VEHICLE : v->Next()->index; case 0x5C: return ClampToI32(v->value); case 0x5D: return GB(ClampToI32(v->value), 8, 24); |