mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-11 00:34:27 +00:00
Codechange: Apply suggestions from code review
This commit is contained in:
parent
2dd2b698d2
commit
921f5afc4d
@ -207,7 +207,7 @@ void Town::InitializeLayout(TownLayout layout)
|
||||
|
||||
void Town::FillCachedName() const
|
||||
{
|
||||
this->cached_name.assign(GetTownName(this));
|
||||
this->cached_name = GetTownName(this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -116,7 +116,11 @@ bool VerifyTownName(uint32 r, const TownNameParams *par, TownNames *town_names)
|
||||
for (const Town *t : Town::Iterate()) {
|
||||
/* We can't just compare the numbers since
|
||||
* several numbers may map to a single name. */
|
||||
if (name == (t->name.empty() ? GetTownName(t) : t->name)) return false;
|
||||
if (t->name.empty()) {
|
||||
if (name == GetTownName(t)) return false;
|
||||
} else {
|
||||
if (name == t->name) return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user