diff options
author | smatz <smatz@openttd.org> | 2008-02-13 19:24:40 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2008-02-13 19:24:40 +0000 |
commit | a0ddc43e92c33436bccc0d16ae935237e02a357e (patch) | |
tree | af07b8c3ed3437ba91111379ab438956940c60bb /src/newgrf_engine.cpp | |
parent | b7cd7919883ebec71a0e8ac88beb4bf72312e0d2 (diff) | |
download | openttd-a0ddc43e92c33436bccc0d16ae935237e02a357e.tar.xz |
(svn r12134) -Change: count the number of ticks a vehicle was running this day to calculate running cost
-Fix [FS#1739]: vehicle profit is now counted with 8bit fract, so it is now shown properly in the vehicle details window
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 e7343eef5..316e07b31 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); - case 0x53: return GB(ClampToI32(v->profit_this_year), 8, 24); - case 0x54: return GB(ClampToI32(v->profit_this_year), 16, 16); - case 0x55: return GB(ClampToI32(v->profit_this_year), 24, 8); - case 0x56: return ClampToI32(v->profit_last_year); - case 0x57: return GB(ClampToI32(v->profit_last_year), 8, 24); - case 0x58: return GB(ClampToI32(v->profit_last_year), 16, 16); - case 0x59: return GB(ClampToI32(v->profit_last_year), 24, 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 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); |