Loading

Paste #p41r06sx1

  1. /**
  2.  * Append an orthogonal area of cleared tiles in _cleared_object_areas, then return with the list.
  3.  * @param cleared_tile The tile being cleared, which then causes the whole object to be cleared.
  4.  * @param coa_tile The top most tile of the area to be appended as cleared.
  5.  * @param coa_w The width (x) of the area to be appended as cleared.
  6.  * @param coa_h The height (y) of the area to be appended as cleared.
  7.  * @return coa The _cleared_object_areas with the appended cleared area.
  8.  */
  9. ClearedObjectArea *MakeClearedObjectArea(TileIndex cleared_tile, TileIndex coa_tile, uint coa_w, uint coa_h)
  10. {
  11.     ClearedObjectArea *coa = FindClearedObject(cleared_tile);
  12.     if (coa == NULL) {
  13.         coa = _cleared_object_areas.Append();
  14.         coa->first_tile = cleared_tile;
  15.         coa->area = TileArea(coa_tile, coa_w, coa_h);
  16.     }
  17.     return coa;
  18. }

Version history

Revision # Author Created at
pmp6dybbk Anonymous 25 Sep 2016, 16:14:41 UTC Diff

Comments