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 | fe48d0be219f2035b146c6444c92c305d9c3bedf (patch) | |
tree | af07b8c3ed3437ba91111379ab438956940c60bb /src/openttd.cpp | |
parent | 833a00def99ecf91bce955e35b82b33e4b7d5517 (diff) | |
download | openttd-fe48d0be219f2035b146c6444c92c305d9c3bedf.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/openttd.cpp')
-rw-r--r-- | src/openttd.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/openttd.cpp b/src/openttd.cpp index e4accf911..f1f55e310 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -2419,6 +2419,16 @@ bool AfterLoadGame() } } + if (CheckSavegameVersion(88)) { + /* Profits are now with 8 bit fract */ + Vehicle *v; + FOR_ALL_VEHICLES(v) { + v->profit_this_year <<= 8; + v->profit_last_year <<= 8; + v->running_ticks = 0; + } + } + return InitializeWindowsAndCaches(); } |