1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-29 09:29:10 +00:00

Fix: Allow resolving house parent scope (town) of unbuilt houses. (#12695)

Return unavailable variable result, instead of nullptr dereference.
This commit is contained in:
2024-05-18 12:33:50 +01:00
committed by GitHub
parent 3f5a354f37
commit ba47d1ca2b

View File

@@ -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 */