summaryrefslogtreecommitdiff
path: root/src/ai
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-08-02 21:19:07 +0000
committerrubidium <rubidium@openttd.org>2007-08-02 21:19:07 +0000
commitb15c0efaa951425d74e8a9ca4104da72a81fe50c (patch)
treec9214850b82261724c3e006bdb90aae810fb06bb /src/ai
parentdb374f600c319f0d230cf5f84e120ea06b5fa41e (diff)
downloadopenttd-b15c0efaa951425d74e8a9ca4104da72a81fe50c.tar.xz
(svn r10756) -Codechange: use vehicle->IsValid in favour of IsValidVehicle(vehicle).
Diffstat (limited to 'src/ai')
-rw-r--r--src/ai/default/default.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ai/default/default.cpp b/src/ai/default/default.cpp
index 5df2b5930..7235ab704 100644
--- a/src/ai/default/default.cpp
+++ b/src/ai/default/default.cpp
@@ -426,7 +426,7 @@ static void AiStateCheckReplaceVehicle(Player *p)
{
const Vehicle* v = p->ai.cur_veh;
- if (!IsValidVehicle(v) ||
+ if (!v->IsValid() ||
v->owner != _current_player ||
v->type > VEH_SHIP ||
_veh_check_replace_proc[v->type - VEH_TRAIN](p, v) == INVALID_ENGINE) {
@@ -443,7 +443,7 @@ static void AiStateDoReplaceVehicle(Player *p)
p->ai.state = AIS_VEH_LOOP;
// vehicle is not owned by the player anymore, something went very wrong.
- if (!IsValidVehicle(v) || v->owner != _current_player) return;
+ if (!v->IsValid() || v->owner != _current_player) return;
_veh_do_replace_proc[v->type - VEH_TRAIN](p);
}