Use town cached name for town list window filtering
This commit is contained in:
@@ -979,8 +979,6 @@ public:
|
|||||||
*/
|
*/
|
||||||
void OnInvalidateData(int data = 0, bool gui_scope = true) override
|
void OnInvalidateData(int data = 0, bool gui_scope = true) override
|
||||||
{
|
{
|
||||||
char buf[MAX_LENGTH_TOWN_NAME_CHARS * MAX_CHAR_LENGTH];
|
|
||||||
|
|
||||||
switch (data) {
|
switch (data) {
|
||||||
case TDIWD_FORCE_REBUILD:
|
case TDIWD_FORCE_REBUILD:
|
||||||
/* This needs to be done in command-scope to enforce rebuilding before resorting invalid data */
|
/* This needs to be done in command-scope to enforce rebuilding before resorting invalid data */
|
||||||
@@ -996,11 +994,7 @@ public:
|
|||||||
const Town *t;
|
const Town *t;
|
||||||
FOR_ALL_TOWNS(t) {
|
FOR_ALL_TOWNS(t) {
|
||||||
this->string_filter.ResetState();
|
this->string_filter.ResetState();
|
||||||
|
this->string_filter.AddLine(t->GetCachedName());
|
||||||
SetDParam(0, t->index);
|
|
||||||
GetString(buf, STR_TOWN_NAME, lastof(buf));
|
|
||||||
|
|
||||||
this->string_filter.AddLine(buf);
|
|
||||||
if (this->string_filter.GetState()) this->towns.push_back(t);
|
if (this->string_filter.GetState()) this->towns.push_back(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user