Fix crash opening landscape window when there are no available objects
See: #713
This commit is contained in:
@@ -120,8 +120,8 @@ uint NewGRFClass<Tspec, Tid, Tmax>::GetUIClassCount()
|
|||||||
template <typename Tspec, typename Tid, Tid Tmax>
|
template <typename Tspec, typename Tid, Tid Tmax>
|
||||||
bool NewGRFClass<Tspec, Tid, Tmax>::HasUIClass()
|
bool NewGRFClass<Tspec, Tid, Tmax>::HasUIClass()
|
||||||
{
|
{
|
||||||
for (uint i = 0; i < Tmax && classes[i].global_id != 0; i++) {
|
for (const auto &cls : NewGRFClass::classes) {
|
||||||
if (classes[i].GetUISpecCount() > 0) return true;
|
if (cls.GetUISpecCount() > 0) return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user