(svn r10756) -Codechange: use vehicle->IsValid in favour of IsValidVehicle(vehicle).

This commit is contained in:
rubidium
2007-08-02 21:19:07 +00:00
parent db374f600c
commit b15c0efaa9
6 changed files with 13 additions and 19 deletions

View File

@@ -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);
}