summaryrefslogtreecommitdiff
path: root/src/ai
diff options
context:
space:
mode:
authorbelugas <belugas@openttd.org>2007-01-30 11:53:35 +0000
committerbelugas <belugas@openttd.org>2007-01-30 11:53:35 +0000
commit0c45071bb018aab652f81b594cffa5b2c4ded0d4 (patch)
treed001f734f6111d6fe12abd4a122d09903325335c /src/ai
parente3b63e6d8327b800a2d318d8f30ef72f3b39f33e (diff)
downloadopenttd-0c45071bb018aab652f81b594cffa5b2c4ded0d4.tar.xz
(svn r8455) -Codechange: Give a more meaningful name (railveh_type)to member flags of RailVehInfo, as well as changing the code to reflect the fact that it was not a flag but rather a one value only variable. Doing so, some evaluations have been simplified.
-Codechange: Add and use RAILVEH_SINGLEHEAD when railveh_type is set to 0, which was implicit before. -Cleanup: Remove some extraneous parenthesis.
Diffstat (limited to 'src/ai')
-rw-r--r--src/ai/default/default.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ai/default/default.cpp b/src/ai/default/default.cpp
index ed805fb43..0d43ff11f 100644
--- a/src/ai/default/default.cpp
+++ b/src/ai/default/default.cpp
@@ -143,8 +143,8 @@ static EngineID AiChooseTrainToBuild(RailType railtype, int32 money, byte flag,
const Engine* e = GetEngine(i);
if (!IsCompatibleRail(rvi->railtype, railtype) ||
- rvi->flags & RVI_WAGON ||
- (rvi->flags & RVI_MULTIHEAD && flag & 1) ||
+ rvi->railveh_type == RAILVEH_WAGON ||
+ (rvi->railveh_type == RAILVEH_MULTIHEAD && flag & 1) ||
!HASBIT(e->player_avail, _current_player) ||
e->reliability < 0x8A3D) {
continue;
@@ -2366,7 +2366,7 @@ static EngineID AiFindBestWagon(CargoID cargo, RailType railtype)
const Engine* e = GetEngine(i);
if (!IsCompatibleRail(rvi->railtype, railtype) ||
- !(rvi->flags & RVI_WAGON) ||
+ rvi->railveh_type != RAILVEH_WAGON ||
!HASBIT(e->player_avail, _current_player)) {
continue;
}