Use Is/Set Accounted

This commit is contained in:
duncanspumpkin 2019-02-26 09:31:59 +00:00
parent fae15fceca
commit 411e5c47a2
2 changed files with 3 additions and 3 deletions

View File

@ -241,7 +241,7 @@ private:
{
if (tileElement->GetType() == TILE_ELEMENT_TYPE_LARGE_SCENERY)
{
tileElement->flags &= ~TILE_ELEMENT_FLAG_LARGE_SCENERY_ACCOUNTED;
tileElement->AsLargeScenery()->SetIsAccounted(false);
}
} while (!(tileElement++)->IsLastForTile());
}

View File

@ -113,11 +113,11 @@ public:
// scenery tile elements.
if (flags & GAME_COMMAND_FLAG_PATH_SCENERY)
{
if (tileElement->flags & TILE_ELEMENT_FLAG_LARGE_SCENERY_ACCOUNTED)
if (tileElement->AsLargeScenery()->IsAccounted())
calculate_cost = false;
// Sets the flag to prevent this being counted in additional calls
tileElement->flags |= TILE_ELEMENT_FLAG_LARGE_SCENERY_ACCOUNTED;
tileElement->AsLargeScenery()->SetIsAccounted(true);
}
}