diff options
author | peter1138 <peter1138@openttd.org> | 2007-06-28 19:14:29 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2007-06-28 19:14:29 +0000 |
commit | fd6f474c88b49da01cdf2062b782007b88a7e1ae (patch) | |
tree | 002a0bd36c3cde999cdf1ec36495b68bbe01111d /src/vehicle.cpp | |
parent | f9935f1fa7b7a1c700ef1c2007c449d69f0fbc4b (diff) | |
download | openttd-fd6f474c88b49da01cdf2062b782007b88a7e1ae.tar.xz |
(svn r10380) -Fix (r10364): when checking for unique names, only check vehicles that can have names, and skip inactive players.
Diffstat (limited to 'src/vehicle.cpp')
-rw-r--r-- | src/vehicle.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 45222cd69..775113536 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -2405,17 +2405,26 @@ static bool IsUniqueVehicleName(const char *name) FOR_ALL_VEHICLES(v) { switch (v->type) { case VEH_TRAIN: + if (!IsTrainEngine(v)) continue; + break; + case VEH_ROAD: + break; + case VEH_AIRCRAFT: + if (!IsNormalAircraft(v)) continue; + break; + case VEH_SHIP: - SetDParam(0, v->index); - GetString(buf, STR_VEHICLE_NAME, lastof(buf)); - if (strcmp(buf, name) == 0) return false; break; default: - break; + continue; } + + SetDParam(0, v->index); + GetString(buf, STR_VEHICLE_NAME, lastof(buf)); + if (strcmp(buf, name) == 0) return false; } return true; |