mirror of https://github.com/OpenTTD/OpenTTD
Fix: Allow resolving house parent scope (town) of unbuilt houses. (#12695)
Return unavailable variable result, instead of nullptr dereference.pull/12696/head
parent
3f5a354f37
commit
ba47d1ca2b
|
@ -17,6 +17,11 @@
|
||||||
|
|
||||||
/* virtual */ uint32_t TownScopeResolver::GetVariable(uint8_t variable, [[maybe_unused]] uint32_t parameter, bool *available) const
|
/* 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;
|
CargoID cid;
|
||||||
switch (variable) {
|
switch (variable) {
|
||||||
/* Larger towns */
|
/* Larger towns */
|
||||||
|
|
Loading…
Reference in New Issue