1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-02-03 18:07:53 +01:00

Close #22014: Change crossingMode to a strong enum (#22020)

This commit is contained in:
Michael Steenbeek
2024-05-12 08:46:32 +02:00
committed by GitHub
parent 57a6b0a00c
commit 5407ba2d55
9 changed files with 36 additions and 40 deletions

View File

@@ -154,8 +154,7 @@ GameActions::Result FootpathLayoutPlaceAction::ElementInsertQuery(GameActions::R
// Do not attempt to build a crossing with a queue or a sloped path.
auto isQueue = _constructFlags & PathConstructFlag::IsQueue;
uint8_t crossingMode = isQueue || (_slope != kTileSlopeFlat) ? CREATE_CROSSING_MODE_NONE
: CREATE_CROSSING_MODE_PATH_OVER_TRACK;
auto crossingMode = isQueue || (_slope != kTileSlopeFlat) ? CreateCrossingMode::none : CreateCrossingMode::pathOverTrack;
auto canBuild = MapCanConstructWithClearAt(
{ _loc, zLow, zHigh }, &MapPlaceNonSceneryClearFunc, quarterTile, GetFlags(), crossingMode);
if (!entrancePath && canBuild.Error != GameActions::Status::Ok)
@@ -225,8 +224,7 @@ GameActions::Result FootpathLayoutPlaceAction::ElementInsertExecute(GameActions:
// Do not attempt to build a crossing with a queue or a sloped path.
auto isQueue = _constructFlags & PathConstructFlag::IsQueue;
uint8_t crossingMode = isQueue || (_slope != kTileSlopeFlat) ? CREATE_CROSSING_MODE_NONE
: CREATE_CROSSING_MODE_PATH_OVER_TRACK;
auto crossingMode = isQueue || (_slope != kTileSlopeFlat) ? CreateCrossingMode::none : CreateCrossingMode::pathOverTrack;
auto canBuild = MapCanConstructWithClearAt(
{ _loc, zLow, zHigh }, &MapPlaceNonSceneryClearFunc, quarterTile, GAME_COMMAND_FLAG_APPLY | GetFlags(), crossingMode);
if (!entrancePath && canBuild.Error != GameActions::Status::Ok)