Use Is/Set Indestructible

This commit is contained in:
duncanspumpkin 2019-02-26 09:35:20 +00:00
parent 411e5c47a2
commit 92cdbfb0a8
3 changed files with 3 additions and 10 deletions

View File

@ -117,7 +117,7 @@ public:
return MakeResult(GA_ERROR::INVALID_PARAMETERS, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS);
}
if (tileElement->flags & TILE_ELEMENT_FLAG_INDESTRUCTIBLE_TRACK_PIECE)
if (tileElement->AsTrack()->IsIndestructible())
{
return MakeResult(
GA_ERROR::DISALLOWED, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_YOU_ARE_NOT_ALLOWED_TO_REMOVE_THIS_SECTION);

View File

@ -1015,7 +1015,7 @@ static money32 track_remove(
return MONEY32_UNDEFINED;
}
if (tileElement->flags & TILE_ELEMENT_FLAG_INDESTRUCTIBLE_TRACK_PIECE)
if (tileElement->AsTrack()->IsIndestructible())
{
gGameCommandErrorText = STR_YOU_ARE_NOT_ALLOWED_TO_REMOVE_THIS_SECTION;
return MONEY32_UNDEFINED;

View File

@ -633,14 +633,7 @@ static bool scenario_prepare_rides_for_save()
}
}
if (markTrackAsIndestructible)
{
it.element->flags |= TILE_ELEMENT_FLAG_INDESTRUCTIBLE_TRACK_PIECE;
}
else
{
it.element->flags &= ~TILE_ELEMENT_FLAG_INDESTRUCTIBLE_TRACK_PIECE;
}
it.element->AsTrack()->SetIsIndestructible(markTrackAsIndestructible);
}
} while (tile_element_iterator_next(&it));