summaryrefslogtreecommitdiff
path: root/src/misc_cmd.cpp
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2007-06-28 19:14:29 +0000
committerpeter1138 <peter1138@openttd.org>2007-06-28 19:14:29 +0000
commitfd6f474c88b49da01cdf2062b782007b88a7e1ae (patch)
tree002a0bd36c3cde999cdf1ec36495b68bbe01111d /src/misc_cmd.cpp
parentf9935f1fa7b7a1c700ef1c2007c449d69f0fbc4b (diff)
downloadopenttd-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/misc_cmd.cpp')
-rw-r--r--src/misc_cmd.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/misc_cmd.cpp b/src/misc_cmd.cpp
index 3a0448f84..830354c53 100644
--- a/src/misc_cmd.cpp
+++ b/src/misc_cmd.cpp
@@ -201,6 +201,7 @@ static bool IsUniqueCompanyName(const char *name)
char buf[512];
FOR_ALL_PLAYERS(p) {
+ if (!p->is_active) continue;
SetDParam(0, p->index);
GetString(buf, STR_COMPANY_NAME, lastof(buf));
if (strcmp(buf, name) == 0) return false;
@@ -245,6 +246,7 @@ static bool IsUniquePresidentName(const char *name)
char buf[512];
FOR_ALL_PLAYERS(p) {
+ if (!p->is_active) continue;
SetDParam(0, p->index);
GetString(buf, STR_PLAYER_NAME, lastof(buf));
if (strcmp(buf, name) == 0) return false;