mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-11 13:10:45 +00:00
Fix crash opening landscape window when there are no available objects
See: #713
This commit is contained in:
parent
15f4e62936
commit
95245d5a57
@ -120,8 +120,8 @@ uint NewGRFClass<Tspec, Tid, Tmax>::GetUIClassCount()
|
||||
template <typename Tspec, typename Tid, Tid Tmax>
|
||||
bool NewGRFClass<Tspec, Tid, Tmax>::HasUIClass()
|
||||
{
|
||||
for (uint i = 0; i < Tmax && classes[i].global_id != 0; i++) {
|
||||
if (classes[i].GetUISpecCount() > 0) return true;
|
||||
for (const auto &cls : NewGRFClass::classes) {
|
||||
if (cls.GetUISpecCount() > 0) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user