OpenTTD / OpenTTD

OpenTTD is an open source simulation game based upon Transport Tycoon Deluxe
https://www.openttd.org/
Other
6.02k stars 843 forks source link

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

Closed PeterN closed 2 weeks ago

PeterN commented 2 weeks ago

Motivation / Problem

If a town house uses parent scope then trying to display it in the House Picker will crash, as TownScopeResolver does not handle a non-existent town.

Description

In TownScopeResolver, return unavailable variable result if town is not set, instead of nullptr dereference.

Limitations

Checklist for review

Some things are not automated, and forgotten often. This list is a reminder for the reviewers.