(svn r10380) -Fix (r10364): when checking for unique names, only check vehicles that can have names, and skip inactive players.

This commit is contained in:
peter1138
2007-06-28 19:14:29 +00:00
parent f9935f1fa7
commit fd6f474c88
2 changed files with 15 additions and 4 deletions

View File

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