forked from mirror/OpenTTD
Codechange: Simplify usage of GRFFileProps by adding some common helper methods.
This commit is contained in:
@@ -273,7 +273,7 @@ static void DrawTile_Town(TileInfo *ti)
|
||||
/* Houses don't necessarily need new graphics. If they don't have a
|
||||
* spritegroup associated with them, then the sprite for the substitute
|
||||
* house id is drawn instead. */
|
||||
if (HouseSpec::Get(house_id)->grf_prop.GetSpriteGroup() != nullptr) {
|
||||
if (HouseSpec::Get(house_id)->grf_prop.HasSpriteGroups()) {
|
||||
DrawNewHouseTile(ti, house_id);
|
||||
return;
|
||||
} else {
|
||||
@@ -334,7 +334,7 @@ static Foundation GetFoundation_Town(TileIndex tile, Slope tileh)
|
||||
*/
|
||||
if (hid >= NEW_HOUSE_OFFSET) {
|
||||
const HouseSpec *hs = HouseSpec::Get(hid);
|
||||
if (hs->grf_prop.GetSpriteGroup() != nullptr && hs->callback_mask.Test(HouseCallbackMask::DrawFoundations)) {
|
||||
if (hs->callback_mask.Test(HouseCallbackMask::DrawFoundations)) {
|
||||
uint32_t callback_res = GetHouseCallback(CBID_HOUSE_DRAW_FOUNDATIONS, 0, 0, hid, Town::GetByTile(tile), tile);
|
||||
if (callback_res != CALLBACK_FAILED && !ConvertBooleanCallback(hs->grf_prop.grffile, CBID_HOUSE_DRAW_FOUNDATIONS, callback_res)) return FOUNDATION_NONE;
|
||||
}
|
||||
|
Reference in New Issue
Block a user