/** * Append an orthogonal area of cleared tiles in _cleared_object_areas, then return with the list. * @param cleared_tile The tile being cleared, which then causes the whole object to be cleared. * @param coa_tile The top most tile of the area to be appended as cleared. * @param coa_w The width (x) of the area to be appended as cleared. * @param coa_h The height (y) of the area to be appended as cleared. * @return coa The _cleared_object_areas with the appended cleared area. */ ClearedObjectArea *MakeClearedObjectArea(TileIndex cleared_tile, TileIndex coa_tile, uint coa_w, uint coa_h) { ClearedObjectArea *coa = FindClearedObject(cleared_tile); if (coa == NULL) { coa = _cleared_object_areas.Append(); coa->first_tile = cleared_tile; coa->area = TileArea(coa_tile, coa_w, coa_h); } return coa; }