summaryrefslogtreecommitdiff
path: root/src/openttd.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2008-02-13 19:24:40 +0000
committersmatz <smatz@openttd.org>2008-02-13 19:24:40 +0000
commita0ddc43e92c33436bccc0d16ae935237e02a357e (patch)
treeaf07b8c3ed3437ba91111379ab438956940c60bb /src/openttd.cpp
parentb7cd7919883ebec71a0e8ac88beb4bf72312e0d2 (diff)
downloadopenttd-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/openttd.cpp')
-rw-r--r--src/openttd.cpp10
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();
}