(svn r14958) -Codechange [FS#1923]: when checking for unique names, compare only with manually set names

There are situations that aren't solvable (because of different language files), so if the user really wants to have duplicated name, allow him to do so. It solves desyncs between server and clients using different languages. It behaves the same in SP and MP, so users won't see the different behaviour as a bug (and even checking in SP could be worked around by the user).
This commit is contained in:
smatz
2009-01-10 15:54:07 +00:00
parent 818b162b35
commit c5db2ea181
7 changed files with 9 additions and 53 deletions

View File

@@ -2895,12 +2895,9 @@ static void UpdateStationWaiting(Station *st, CargoID type, uint amount)
static bool IsUniqueStationName(const char *name)
{
const Station *st;
char buf[512];
FOR_ALL_STATIONS(st) {
SetDParam(0, st->index);
GetString(buf, STR_STATION, lastof(buf));
if (strcmp(buf, name) == 0) return false;
if (st->name != NULL && strcmp(st->name, name) == 0) return false;
}
return true;