mirror of https://github.com/OpenTTD/OpenTTD.git
Fix: Allow resolving house parent scope (town) of unbuilt houses. (#12695)
Return unavailable variable result, instead of nullptr dereference.
This commit is contained in:
parent
3f5a354f37
commit
ba47d1ca2b
|
@ -17,6 +17,11 @@
|
|||
|
||||
/* virtual */ uint32_t TownScopeResolver::GetVariable(uint8_t variable, [[maybe_unused]] uint32_t parameter, bool *available) const
|
||||
{
|
||||
if (this->t == nullptr) {
|
||||
*available = false;
|
||||
return UINT_MAX;
|
||||
}
|
||||
|
||||
CargoID cid;
|
||||
switch (variable) {
|
||||
/* Larger towns */
|
||||
|
|
Loading…
Reference in New Issue