From 92cdbfb0a81938c556e79a5b3204f3f83c91e23e Mon Sep 17 00:00:00 2001 From: duncanspumpkin Date: Tue, 26 Feb 2019 09:35:20 +0000 Subject: [PATCH] Use Is/Set Indestructible --- src/openrct2/actions/TrackRemoveAction.hpp | 2 +- src/openrct2/ride/Track.cpp | 2 +- src/openrct2/scenario/Scenario.cpp | 9 +-------- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/openrct2/actions/TrackRemoveAction.hpp b/src/openrct2/actions/TrackRemoveAction.hpp index 13c9d2683d..fb73e5c763 100644 --- a/src/openrct2/actions/TrackRemoveAction.hpp +++ b/src/openrct2/actions/TrackRemoveAction.hpp @@ -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); diff --git a/src/openrct2/ride/Track.cpp b/src/openrct2/ride/Track.cpp index d196a83515..b5421f73e5 100644 --- a/src/openrct2/ride/Track.cpp +++ b/src/openrct2/ride/Track.cpp @@ -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; diff --git a/src/openrct2/scenario/Scenario.cpp b/src/openrct2/scenario/Scenario.cpp index b2e7578fec..76761bc8c6 100644 --- a/src/openrct2/scenario/Scenario.cpp +++ b/src/openrct2/scenario/Scenario.cpp @@ -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));