summaryrefslogtreecommitdiff
path: root/src/engine.cpp
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2008-06-05 12:08:20 +0000
committerpeter1138 <peter1138@openttd.org>2008-06-05 12:08:20 +0000
commit0a41936df8d296e8e7e7e4672a462ea1326f15d2 (patch)
tree21c4af38a92bd99fdbede2d74c78ed36bfbd5ca9 /src/engine.cpp
parent5990a92bcaf34eff860099b8ba53585dc4071e8c (diff)
downloadopenttd-0a41936df8d296e8e7e7e4672a462ea1326f15d2.tar.xz
(svn r13388) -Codechange: Remove "my invented flag for something that is a wagon"
Diffstat (limited to 'src/engine.cpp')
-rw-r--r--src/engine.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/engine.cpp b/src/engine.cpp
index d2a0f2bb6..71e09773b 100644
--- a/src/engine.cpp
+++ b/src/engine.cpp
@@ -184,6 +184,13 @@ void LoadCustomEngineNames()
DEBUG(misc, 1, "LoadCustomEngineNames: not done");
}
+/* Determine if an engine type is a wagon (and not a loco) */
+static bool IsWagon(EngineID index)
+{
+ const Engine *e = GetEngine(index);
+ return e->type == VEH_TRAIN && e->u.rail.railveh_type == RAILVEH_WAGON;
+}
+
static void CalcEngineReliability(Engine *e)
{
uint age = e->age;
@@ -256,10 +263,9 @@ void StartupEngines()
e->duration_phase_2 = GB(r, 5, 4) + ei->base_life * 12 - 96;
e->duration_phase_3 = GB(r, 9, 7) + 120;
- e->reliability_spd_dec = (ei->unk2&0x7F) << 2;
+ e->reliability_spd_dec = ei->decay_speed << 2;
- /* my invented flag for something that is a wagon */
- if (ei->unk2 & 0x80) {
+ if (IsWagon(e->index)) {
e->age = 0xFFFF;
} else {
CalcEngineReliability(e);
@@ -377,13 +383,6 @@ CommandCost CmdWantEnginePreview(TileIndex tile, uint32 flags, uint32 p1, uint32
return CommandCost();
}
-/* Determine if an engine type is a wagon (and not a loco) */
-static bool IsWagon(EngineID index)
-{
- const Engine *e = GetEngine(index);
- return e->type == VEH_TRAIN && e->u.rail.railveh_type == RAILVEH_WAGON;
-}
-
StringID GetEngineCategoryName(EngineID engine);
static void NewVehicleAvailable(Engine *e)