(svn r10009) -Codechange: Add and use Vehicle::IsPrimaryVehicle to replace individual checks depending on the vehicle type.

This commit is contained in:
maedhros
2007-06-01 12:03:10 +00:00
parent ab8503f5a5
commit 4acf3e4c3f
10 changed files with 31 additions and 33 deletions

View File

@@ -117,10 +117,7 @@ int UpdateCompanyRatingAndValue(Player *p, bool update)
FOR_ALL_VEHICLES(v) {
if (v->owner != owner) continue;
if ((v->type == VEH_TRAIN && IsFrontEngine(v)) ||
v->type == VEH_ROAD ||
(v->type == VEH_AIRCRAFT && IsNormalAircraft(v)) ||
v->type == VEH_SHIP) {
if (IsPlayerBuildableVehicleType(v->type) && v->IsPrimaryVehicle()) {
num++;
if (v->age > 730) {
/* Find the vehicle with the lowest amount of profit */