Make Coords isNull/setNull functions TitleCase (#15382)

This commit is contained in:
Michael Steenbeek 2021-09-09 01:48:53 +02:00 committed by GitHub
parent e00eb3ec52
commit 624a32e93b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
46 changed files with 246 additions and 246 deletions

View File

@ -375,7 +375,7 @@ InteractionInfo ViewportInteractionGetItemRight(const ScreenCoordsXY& screenCoor
stationIndex = tileElement->AsTrack()->GetStationIndex();
for (i = stationIndex; i >= 0; i--)
if (ride->stations[i].Start.isNull())
if (ride->stations[i].Start.IsNull())
stationIndex--;
stationIndex++;
ft.Add<uint16_t>(stationIndex);
@ -761,7 +761,7 @@ CoordsXY ViewportInteractionGetTileStartAtCursor(const ScreenCoordsXY& screenCoo
if (window == nullptr || window->viewport == nullptr)
{
CoordsXY ret{};
ret.setNull();
ret.SetNull();
return ret;
}
auto viewport = window->viewport;
@ -771,7 +771,7 @@ CoordsXY ViewportInteractionGetTileStartAtCursor(const ScreenCoordsXY& screenCoo
if (info.SpriteType == ViewportInteractionItem::None)
{
initialPos.setNull();
initialPos.SetNull();
return initialPos;
}

View File

@ -798,7 +798,7 @@ static void window_footpath_set_selection_start_bridge_at_point(const ScreenCoor
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW;
auto mapCoords = footpath_bridge_get_info_from_pos(screenCoords, &direction, &tileElement);
if (mapCoords.isNull())
if (mapCoords.IsNull())
{
return;
}
@ -904,7 +904,7 @@ static void window_footpath_start_bridge_at_point(const ScreenCoordsXY& screenCo
TileElement* tileElement;
auto mapCoords = footpath_bridge_get_info_from_pos(screenCoords, &direction, &tileElement);
if (mapCoords.isNull())
if (mapCoords.IsNull())
{
return;
}

View File

@ -585,7 +585,7 @@ void window_guest_overview_mouse_up(rct_window* w, rct_widgetindex widgetIndex)
}
w->picked_peep_old_x = peep->x;
CoordsXYZ nullLoc{};
nullLoc.setNull();
nullLoc.SetNull();
PeepPickupAction pickupAction{ PeepPickupType::Pickup, w->number, nullLoc, network_get_current_player_id() };
pickupAction.SetCallback([peepnum = w->number](const GameAction* ga, const GameActions::Result* result) {
if (result->Error != GameActions::Status::Ok)
@ -1132,7 +1132,7 @@ void window_guest_overview_tool_update(rct_window* w, rct_widgetindex widgetInde
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE;
auto mapCoords = footpath_get_coordinates_from_pos({ screenCoords.x, screenCoords.y + 16 }, nullptr, nullptr);
if (!mapCoords.isNull())
if (!mapCoords.IsNull())
{
gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE;
gMapSelectType = MAP_SELECT_TYPE_FULL;
@ -1180,7 +1180,7 @@ void window_guest_overview_tool_down(rct_window* w, rct_widgetindex widgetIndex,
TileElement* tileElement;
auto destCoords = footpath_get_coordinates_from_pos({ screenCoords.x, screenCoords.y + 16 }, nullptr, &tileElement);
if (destCoords.isNull())
if (destCoords.IsNull())
return;
PeepPickupAction pickupAction{

View File

@ -1216,13 +1216,13 @@ static CoordsXYZD place_park_entrance_get_map_position(const ScreenCoordsXY& scr
CoordsXYZD parkEntranceMapPosition{ 0, 0, 0, INVALID_DIRECTION };
const CoordsXY mapCoords = ViewportInteractionGetTileStartAtCursor(screenCoords);
parkEntranceMapPosition = { mapCoords.x, mapCoords.y, 0, INVALID_DIRECTION };
if (parkEntranceMapPosition.isNull())
if (parkEntranceMapPosition.IsNull())
return parkEntranceMapPosition;
auto surfaceElement = map_get_surface_element_at(mapCoords);
if (surfaceElement == nullptr)
{
parkEntranceMapPosition.setNull();
parkEntranceMapPosition.SetNull();
return parkEntranceMapPosition;
}
@ -1257,7 +1257,7 @@ static void window_map_place_park_entrance_tool_update(const ScreenCoordsXY& scr
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW;
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT;
CoordsXYZD parkEntrancePosition = place_park_entrance_get_map_position(screenCoords);
if (parkEntrancePosition.isNull())
if (parkEntrancePosition.IsNull())
{
park_entrance_remove_ghost();
return;
@ -1298,7 +1298,7 @@ static void window_map_set_peep_spawn_tool_update(const ScreenCoordsXY& screenCo
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE;
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW;
auto mapCoords = footpath_bridge_get_info_from_pos(screenCoords, &direction, &tileElement);
if (mapCoords.isNull())
if (mapCoords.IsNull())
return;
mapZ = tileElement->GetBaseZ();
@ -1329,7 +1329,7 @@ static void window_map_place_park_entrance_tool_down(const ScreenCoordsXY& scree
park_entrance_remove_ghost();
CoordsXYZD parkEntrancePosition = place_park_entrance_get_map_position(screenCoords);
if (!parkEntrancePosition.isNull())
if (!parkEntrancePosition.IsNull())
{
auto gameAction = PlaceParkEntranceAction(parkEntrancePosition, gFootpathSelectedId);
auto result = GameActions::Execute(&gameAction);
@ -1351,7 +1351,7 @@ static void window_map_set_peep_spawn_tool_down(const ScreenCoordsXY& screenCoor
// Verify footpath exists at location, and retrieve coordinates
auto mapCoords = footpath_get_coordinates_from_pos(screenCoords, &direction, &tileElement);
if (mapCoords.isNull())
if (mapCoords.IsNull())
return;
mapZ = tileElement->GetBaseZ();

View File

@ -159,7 +159,7 @@ static void window_maze_construction_close(rct_window* w)
auto ride = get_ride(_currentRideIndex);
if (ride != nullptr)
{
if (ride->overall_view.isNull())
if (ride->overall_view.IsNull())
{
int32_t savedPausedState = gGamePaused;
gGamePaused = 0;
@ -366,7 +366,7 @@ static void window_maze_construction_entrance_tooldown(const ScreenCoordsXY& scr
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW;
CoordsXYZD entranceOrExitCoords = ride_get_entrance_or_exit_position_from_screen_position(screenCoords);
if (entranceOrExitCoords.isNull())
if (entranceOrExitCoords.IsNull())
return;
if (gRideEntranceExitPlaceDirection == INVALID_DIRECTION)

View File

@ -1334,7 +1334,7 @@ static rct_window* window_ride_open_station(Ride* ride, StationIndex stationInde
// View
for (int32_t i = stationIndex; i >= 0; i--)
{
if (ride->stations[i].Start.isNull())
if (ride->stations[i].Start.IsNull())
{
stationIndex--;
}
@ -1564,7 +1564,7 @@ static std::optional<StationIndex> GetStationIndexFromViewSelection(const rct_wi
for (StationIndex index = 0; index < sizeof(ride->stations); ++index)
{
const auto& station = ride->stations[index];
if (!station.Start.isNull())
if (!station.Start.IsNull())
{
if (viewSelectionIndex-- == 0)
{
@ -1688,7 +1688,7 @@ static void window_ride_init_viewport(rct_window* w)
w->viewport_focus_coordinates.height = w->height;
// rct2: 0x006aec9c only used here so brought it into the function
if (!w->viewport && !ride->overall_view.isNull())
if (!w->viewport && !ride->overall_view.IsNull())
{
rct_widget* view_widget = &w->widgets[WIDX_VIEWPORT];
@ -2558,14 +2558,14 @@ static rct_string_id window_ride_get_status_station(rct_window* w, Formatter& ft
// Entrance / exit
if (ride->status == RideStatus::Closed)
{
if (ride_get_entrance_location(ride, static_cast<uint8_t>(*stationIndex)).isNull())
if (ride_get_entrance_location(ride, static_cast<uint8_t>(*stationIndex)).IsNull())
stringId = STR_NO_ENTRANCE;
else if (ride_get_exit_location(ride, static_cast<uint8_t>(*stationIndex)).isNull())
else if (ride_get_exit_location(ride, static_cast<uint8_t>(*stationIndex)).IsNull())
stringId = STR_NO_EXIT;
}
else
{
if (ride_get_entrance_location(ride, static_cast<uint8_t>(*stationIndex)).isNull())
if (ride_get_entrance_location(ride, static_cast<uint8_t>(*stationIndex)).IsNull())
stringId = STR_EXIT_ONLY;
}
// Queue length

View File

@ -2159,7 +2159,7 @@ static std::optional<CoordsXY> ride_get_place_position_from_screen_position(Scre
if (!_trackPlaceCtrlState)
{
mapCoords = ViewportInteractionGetTileStartAtCursor(screenCoords);
if (mapCoords.isNull())
if (mapCoords.IsNull())
return std::nullopt;
_trackPlaceZ = 0;

View File

@ -415,7 +415,7 @@ void window_staff_overview_mouseup(rct_window* w, rct_widgetindex widgetIndex)
{
w->picked_peep_old_x = peep->x;
CoordsXYZ nullLoc{};
nullLoc.setNull();
nullLoc.SetNull();
PeepPickupAction pickupAction{ PeepPickupType::Pickup, w->number, nullLoc, network_get_current_player_id() };
pickupAction.SetCallback([peepnum = w->number](const GameAction* ga, const GameActions::Result* result) {
if (result->Error != GameActions::Status::Ok)
@ -1138,7 +1138,7 @@ void window_staff_overview_tool_update(rct_window* w, rct_widgetindex widgetInde
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE;
auto mapCoords = footpath_get_coordinates_from_pos({ screenCoords.x, screenCoords.y + 16 }, nullptr, nullptr);
if (!mapCoords.isNull())
if (!mapCoords.IsNull())
{
gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE;
gMapSelectType = MAP_SELECT_TYPE_FULL;
@ -1185,7 +1185,7 @@ void window_staff_overview_tool_down(rct_window* w, rct_widgetindex widgetIndex,
TileElement* tileElement;
auto destCoords = footpath_get_coordinates_from_pos({ screenCoords.x, screenCoords.y + 16 }, nullptr, &tileElement);
if (destCoords.isNull())
if (destCoords.IsNull())
return;
PeepPickupAction pickupAction{
@ -1203,7 +1203,7 @@ void window_staff_overview_tool_down(rct_window* w, rct_widgetindex widgetIndex,
{
auto destCoords = footpath_get_coordinates_from_pos(screenCoords, nullptr, nullptr);
if (destCoords.isNull())
if (destCoords.IsNull())
return;
auto staff = TryGetEntity<Staff>(w->number);
@ -1239,7 +1239,7 @@ void window_staff_overview_tool_drag(rct_window* w, rct_widgetindex widgetIndex,
auto destCoords = footpath_get_coordinates_from_pos(screenCoords, nullptr, nullptr);
if (destCoords.isNull())
if (destCoords.IsNull())
return;
auto staff = TryGetEntity<Staff>(w->number);

View File

@ -552,7 +552,7 @@ private:
int32_t direction{};
TileElement* tileElement{};
auto footpathCoords = footpath_get_coordinates_from_pos(screenCoords, &direction, &tileElement);
if (footpathCoords.isNull())
if (footpathCoords.IsNull())
return nullptr;
auto isPatrolAreaSet = staff_is_patrol_area_set_for_type(GetSelectedStaffType(), footpathCoords);

View File

@ -1241,7 +1241,7 @@ static void sub_6E1F34_small_scenery(
if (w == nullptr)
{
gridPos.setNull();
gridPos.SetNull();
return;
}
@ -1269,7 +1269,7 @@ static void sub_6E1F34_small_scenery(
auto gridCoords = screen_get_map_xy_quadrant(screenPos, &quadrant);
if (!gridCoords)
{
gridPos.setNull();
gridPos.SetNull();
return;
}
gridPos = *gridCoords;
@ -1283,7 +1283,7 @@ static void sub_6E1F34_small_scenery(
if (surfaceElement == nullptr)
{
gridPos.setNull();
gridPos.SetNull();
return;
}
@ -1302,7 +1302,7 @@ static void sub_6E1F34_small_scenery(
auto mapCoords = screen_get_map_xy_quadrant_with_z(screenPos, z, &quadrant);
if (!mapCoords)
{
gridPos.setNull();
gridPos.SetNull();
return;
}
gridPos = *mapCoords;
@ -1318,7 +1318,7 @@ static void sub_6E1F34_small_scenery(
gSceneryPlaceZ = z;
}
if (gridPos.isNull())
if (gridPos.IsNull())
return;
uint8_t rotation = gWindowSceneryRotation;
@ -1352,7 +1352,7 @@ static void sub_6E1F34_small_scenery(
if (info.SpriteType == ViewportInteractionItem::None)
{
gridPos.setNull();
gridPos.SetNull();
return;
}
@ -1366,7 +1366,7 @@ static void sub_6E1F34_small_scenery(
if (surfaceElement == nullptr)
{
gridPos.setNull();
gridPos.SetNull();
return;
}
@ -1388,7 +1388,7 @@ static void sub_6E1F34_small_scenery(
}
else
{
gridPos.setNull();
gridPos.SetNull();
}
// If SHIFT pressed
if (gSceneryShiftPressed)
@ -1401,7 +1401,7 @@ static void sub_6E1F34_small_scenery(
gSceneryPlaceZ = z;
}
if (gridPos.isNull())
if (gridPos.IsNull())
return;
gridPos = gridPos.ToTileStart();
@ -1431,7 +1431,7 @@ static void sub_6E1F34_path_item(
if (w == nullptr)
{
gridPos.setNull();
gridPos.SetNull();
return;
}
@ -1445,7 +1445,7 @@ static void sub_6E1F34_path_item(
if (info.SpriteType == ViewportInteractionItem::None)
{
gridPos.setNull();
gridPos.SetNull();
return;
}
@ -1464,7 +1464,7 @@ static void sub_6E1F34_wall(
if (w == nullptr)
{
gridPos.setNull();
gridPos.SetNull();
return;
}
@ -1487,7 +1487,7 @@ static void sub_6E1F34_wall(
auto gridCoords = screen_get_map_xy_side(screenPos, &edge);
if (!gridCoords)
{
gridPos.setNull();
gridPos.SetNull();
return;
}
gridPos = *gridCoords;
@ -1501,7 +1501,7 @@ static void sub_6E1F34_wall(
if (surfaceElement == nullptr)
{
gridPos.setNull();
gridPos.SetNull();
return;
}
@ -1519,7 +1519,7 @@ static void sub_6E1F34_wall(
auto mapCoords = screen_get_map_xy_side_with_z(screenPos, z, &edge);
if (!mapCoords)
{
gridPos.setNull();
gridPos.SetNull();
return;
}
gridPos = *mapCoords;
@ -1535,7 +1535,7 @@ static void sub_6E1F34_wall(
gSceneryPlaceZ = z;
}
if (gridPos.isNull())
if (gridPos.IsNull())
return;
if (gConfigGeneral.virtual_floor_style != VirtualFloorStyles::Off)
@ -1553,7 +1553,7 @@ static void sub_6E1F34_large_scenery(
if (w == nullptr)
{
gridPos.setNull();
gridPos.SetNull();
return;
}
@ -1580,7 +1580,7 @@ static void sub_6E1F34_large_scenery(
const CoordsXY mapCoords = ViewportInteractionGetTileStartAtCursor(screenPos);
gridPos = mapCoords;
if (gridPos.isNull())
if (gridPos.IsNull())
return;
gSceneryPlaceZ = 0;
@ -1592,7 +1592,7 @@ static void sub_6E1F34_large_scenery(
if (surfaceElement == nullptr)
{
gridPos.setNull();
gridPos.SetNull();
return;
}
@ -1614,7 +1614,7 @@ static void sub_6E1F34_large_scenery(
}
else
{
gridPos.setNull();
gridPos.SetNull();
}
// If SHIFT pressed
@ -1628,7 +1628,7 @@ static void sub_6E1F34_large_scenery(
gSceneryPlaceZ = z;
}
if (gridPos.isNull())
if (gridPos.IsNull())
return;
gridPos = gridPos.ToTileStart();
@ -1653,7 +1653,7 @@ static void sub_6E1F34_banner(
if (w == nullptr)
{
gridPos.setNull();
gridPos.SetNull();
return;
}
@ -1667,7 +1667,7 @@ static void sub_6E1F34_banner(
if (info.SpriteType == ViewportInteractionItem::None)
{
gridPos.setNull();
gridPos.SetNull();
return;
}
@ -1728,7 +1728,7 @@ static void window_top_toolbar_scenery_tool_down(const ScreenCoordsXY& windowPos
uint8_t quadrant;
Direction rotation;
sub_6E1F34_small_scenery(windowPos, selectedScenery, gridPos, &quadrant, &rotation);
if (gridPos.isNull())
if (gridPos.IsNull())
return;
int32_t quantity = 1;
@ -1848,7 +1848,7 @@ static void window_top_toolbar_scenery_tool_down(const ScreenCoordsXY& windowPos
{
int32_t z;
sub_6E1F34_path_item(windowPos, selectedScenery, gridPos, &z);
if (gridPos.isNull())
if (gridPos.IsNull())
return;
auto footpathAdditionPlaceAction = FootpathAdditionPlaceAction({ gridPos, z }, selectedScenery + 1);
@ -1867,7 +1867,7 @@ static void window_top_toolbar_scenery_tool_down(const ScreenCoordsXY& windowPos
{
uint8_t edges;
sub_6E1F34_wall(windowPos, selectedScenery, gridPos, &edges);
if (gridPos.isNull())
if (gridPos.IsNull())
return;
uint8_t zAttemptRange = 1;
@ -1919,7 +1919,7 @@ static void window_top_toolbar_scenery_tool_down(const ScreenCoordsXY& windowPos
{
Direction direction;
sub_6E1F34_large_scenery(windowPos, selectedScenery, gridPos, &direction);
if (gridPos.isNull())
if (gridPos.IsNull())
return;
uint8_t zAttemptRange = 1;
@ -1977,7 +1977,7 @@ static void window_top_toolbar_scenery_tool_down(const ScreenCoordsXY& windowPos
int32_t z;
Direction direction;
sub_6E1F34_banner(windowPos, selectedScenery, gridPos, &z, &direction);
if (gridPos.isNull())
if (gridPos.IsNull())
return;
CoordsXYZD loc{ gridPos, z, direction };
@ -2628,7 +2628,7 @@ static void top_toolbar_tool_update_scenery(const ScreenCoordsXY& screenPos)
sub_6E1F34_small_scenery(screenPos, selection.EntryIndex, mapTile, &quadrant, &rotation);
if (mapTile.isNull())
if (mapTile.IsNull())
{
scenery_remove_ghost_tool_placement();
return;
@ -2706,7 +2706,7 @@ static void top_toolbar_tool_update_scenery(const ScreenCoordsXY& screenPos)
sub_6E1F34_path_item(screenPos, selection.EntryIndex, mapTile, &z);
if (mapTile.isNull())
if (mapTile.IsNull())
{
scenery_remove_ghost_tool_placement();
return;
@ -2741,7 +2741,7 @@ static void top_toolbar_tool_update_scenery(const ScreenCoordsXY& screenPos)
sub_6E1F34_wall(screenPos, selection.EntryIndex, mapTile, &edge);
if (mapTile.isNull())
if (mapTile.IsNull())
{
scenery_remove_ghost_tool_placement();
return;
@ -2796,7 +2796,7 @@ static void top_toolbar_tool_update_scenery(const ScreenCoordsXY& screenPos)
sub_6E1F34_large_scenery(screenPos, selection.EntryIndex, mapTile, &direction);
if (mapTile.isNull())
if (mapTile.IsNull())
{
scenery_remove_ghost_tool_placement();
return;
@ -2863,7 +2863,7 @@ static void top_toolbar_tool_update_scenery(const ScreenCoordsXY& screenPos)
sub_6E1F34_banner(screenPos, selection.EntryIndex, mapTile, &z, &direction);
if (mapTile.isNull())
if (mapTile.IsNull())
{
scenery_remove_ghost_tool_placement();
return;

View File

@ -152,7 +152,7 @@ rct_window* window_track_place_open(const track_design_file_ref* tdFileRef)
window_push_others_right(w);
show_gridlines();
_window_track_place_last_cost = MONEY32_UNDEFINED;
_windowTrackPlaceLast.setNull();
_windowTrackPlaceLast.SetNull();
_currentTrackPieceDirection = (2 - get_current_rotation()) & 3;
window_track_place_clear_mini_preview();
@ -193,14 +193,14 @@ static void window_track_place_mouseup(rct_window* w, rct_widgetindex widgetInde
window_track_place_clear_provisional();
_currentTrackPieceDirection = (_currentTrackPieceDirection + 1) & 3;
w->Invalidate();
_windowTrackPlaceLast.setNull();
_windowTrackPlaceLast.SetNull();
window_track_place_draw_mini_preview(_trackDesign.get());
break;
case WIDX_MIRROR:
track_design_mirror(_trackDesign.get());
_currentTrackPieceDirection = (0 - _currentTrackPieceDirection) & 3;
w->Invalidate();
_windowTrackPlaceLast.setNull();
_windowTrackPlaceLast.SetNull();
window_track_place_draw_mini_preview(_trackDesign.get());
break;
case WIDX_SELECT_DIFFERENT_DESIGN:
@ -259,7 +259,7 @@ static void window_track_place_toolupdate(rct_window* w, rct_widgetindex widgetI
// Get the tool map position
CoordsXY mapCoords = ViewportInteractionGetTileStartAtCursor(screenCoords);
if (mapCoords.isNull())
if (mapCoords.IsNull())
{
window_track_place_clear_provisional();
return;
@ -324,7 +324,7 @@ static void window_track_place_tooldown(rct_window* w, rct_widgetindex widgetInd
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW;
const CoordsXY mapCoords = ViewportInteractionGetTileStartAtCursor(screenCoords);
if (mapCoords.isNull())
if (mapCoords.IsNull())
return;
// Try increasing Z until a feasible placement is found

View File

@ -857,7 +857,7 @@ namespace OpenRCT2
}
// Focus camera on event.
if (isPositionValid && !result->Position.isNull())
if (isPositionValid && !result->Position.IsNull())
{
auto* mainWindow = window_get_main();
if (mainWindow != nullptr)

View File

@ -492,7 +492,7 @@ namespace GameActions
network_add_player_money_spent(playerIndex, result->Cost);
}
if (!result->Position.isNull())
if (!result->Position.IsNull())
{
network_set_player_last_action_coord(playerIndex, result->Position);
}

View File

@ -43,7 +43,7 @@ GameActions::Result::Ptr PeepPickupAction::Query() const
return MakeResult(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE);
}
if (!_loc.isNull() && !LocationValid(_loc))
if (!_loc.IsNull() && !LocationValid(_loc))
{
return MakeResult(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE);
}

View File

@ -140,12 +140,12 @@ GameActions::Result::Ptr RideCreateAction::Execute() const
ride->type = _rideType;
ride->subtype = rideEntryIndex;
ride->SetColourPreset(_colour1);
ride->overall_view.setNull();
ride->overall_view.SetNull();
ride->SetNameToDefault();
for (int32_t i = 0; i < MAX_STATIONS; i++)
{
ride->stations[i].Start.setNull();
ride->stations[i].Start.SetNull();
ride_clear_entrance_location(ride, i);
ride_clear_exit_location(ride, i);
ride->stations[i].TrainAtStation = RideStation::NO_TRAIN;

View File

@ -147,7 +147,7 @@ GameActions::Result::Ptr RideDemolishAction::DemolishRide(Ride* ride) const
res->Expenditure = ExpenditureType::RideConstruction;
res->Cost = refundPrice;
if (!ride->overall_view.isNull())
if (!ride->overall_view.IsNull())
{
auto xy = ride->overall_view.ToTileCentre();
res->Position = { xy, tile_element_height(xy) };
@ -266,7 +266,7 @@ GameActions::Result::Ptr RideDemolishAction::RefurbishRide(Ride* ride) const
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAINTENANCE | RIDE_INVALIDATE_RIDE_CUSTOMER;
if (!ride->overall_view.isNull())
if (!ride->overall_view.IsNull())
{
auto location = ride->overall_view.ToTileCentre();
res->Position = { location, tile_element_height(location) };

View File

@ -76,7 +76,7 @@ GameActions::Result::Ptr RideEntranceExitPlaceAction::Query() const
const auto location = _isExit ? ride_get_exit_location(ride, _stationNum) : ride_get_entrance_location(ride, _stationNum);
if (!location.isNull())
if (!location.IsNull())
{
auto rideEntranceExitRemove = RideEntranceExitRemoveAction(location.ToCoordsXY(), _rideIndex, _stationNum, _isExit);
rideEntranceExitRemove.SetFlags(GetFlags());
@ -143,7 +143,7 @@ GameActions::Result::Ptr RideEntranceExitPlaceAction::Execute() const
}
const auto location = _isExit ? ride_get_exit_location(ride, _stationNum) : ride_get_entrance_location(ride, _stationNum);
if (!location.isNull())
if (!location.IsNull())
{
auto rideEntranceExitRemove = RideEntranceExitRemoveAction(location.ToCoordsXY(), _rideIndex, _stationNum, _isExit);
rideEntranceExitRemove.SetFlags(GetFlags());

View File

@ -142,7 +142,7 @@ GameActions::Result::Ptr RideSetAppearanceAction::Execute() const
window_invalidate_by_number(WC_RIDE, _rideIndex);
auto res = std::make_unique<GameActions::Result>();
if (!ride->overall_view.isNull())
if (!ride->overall_view.IsNull())
{
auto location = ride->overall_view.ToTileCentre();
res->Position = { location, tile_element_height(location) };

View File

@ -87,7 +87,7 @@ GameActions::Result::Ptr RideSetPriceAction::Execute() const
return MakeResult(GameActions::Status::InvalidParameters, STR_NONE);
}
if (!ride->overall_view.isNull())
if (!ride->overall_view.IsNull())
{
auto location = ride->overall_view.ToTileCentre();
res->Position = { location, tile_element_height(location) };

View File

@ -228,7 +228,7 @@ GameActions::Result::Ptr RideSetSettingAction::Execute() const
}
auto res = std::make_unique<GameActions::Result>();
if (!ride->overall_view.isNull())
if (!ride->overall_view.IsNull())
{
auto location = ride->overall_view.ToTileCentre();
res->Position = { location, tile_element_height(location) };

View File

@ -131,7 +131,7 @@ GameActions::Result::Ptr RideSetStatusAction::Execute() const
Formatter ft(res->ErrorMessageArgs.data());
ft.Increment(6);
ride->FormatNameTo(ft);
if (!ride->overall_view.isNull())
if (!ride->overall_view.IsNull())
{
auto location = ride->overall_view.ToTileCentre();
res->Position = { location, tile_element_height(location) };

View File

@ -192,7 +192,7 @@ GameActions::Result::Ptr RideSetVehicleAction::Execute() const
ride->UpdateMaxVehicles();
auto res = std::make_unique<GameActions::Result>();
if (!ride->overall_view.isNull())
if (!ride->overall_view.IsNull())
{
auto location = ride->overall_view.ToTileCentre();
res->Position = { location, tile_element_height(res->Position) };

View File

@ -534,7 +534,7 @@ GameActions::Result::Ptr TrackPlaceAction::Execute() const
}
int32_t entranceDirections = 0;
if (!ride->overall_view.isNull())
if (!ride->overall_view.IsNull())
{
if (!(GetFlags() & GAME_COMMAND_FLAG_NO_SPEND))
{
@ -542,7 +542,7 @@ GameActions::Result::Ptr TrackPlaceAction::Execute() const
}
}
if (entranceDirections & TRACK_SEQUENCE_FLAG_ORIGIN || ride->overall_view.isNull())
if (entranceDirections & TRACK_SEQUENCE_FLAG_ORIGIN || ride->overall_view.IsNull())
{
ride->overall_view = mapLoc;
}

View File

@ -106,7 +106,7 @@ std::optional<ScreenCoordsXY> centre_2d_coordinates(const CoordsXYZ& loc, rct_vi
// If the start location was invalid
// propagate the invalid location to the output.
// This fixes a bug that caused the game to enter an infinite loop.
if (loc.isNull())
if (loc.IsNull())
{
return std::nullopt;
}

View File

@ -212,7 +212,7 @@ std::optional<CoordsXYZ> News::GetSubjectLocation(News::ItemType type, int32_t s
case News::ItemType::Ride:
{
Ride* ride = get_ride(subject);
if (ride == nullptr || ride->overall_view.isNull())
if (ride == nullptr || ride->overall_view.IsNull())
{
break;
}
@ -271,7 +271,7 @@ std::optional<CoordsXYZ> News::GetSubjectLocation(News::ItemType type, int32_t s
auto subjectUnsigned = static_cast<uint32_t>(subject);
auto subjectXY = CoordsXY{ static_cast<int16_t>(subjectUnsigned & 0xFFFF),
static_cast<int16_t>(subjectUnsigned >> 16) };
if (!subjectXY.isNull())
if (!subjectXY.IsNull())
{
subjectLoc = CoordsXYZ{ subjectXY, tile_element_height(subjectXY) };
}

View File

@ -2460,7 +2460,7 @@ static void peep_choose_seat_from_car(Peep* peep, Ride* ride, Vehicle* vehicle)
void Guest::GoToRideEntrance(Ride* ride)
{
TileCoordsXYZD tileLocation = ride_get_entrance_location(ride, CurrentRideStation);
if (tileLocation.isNull())
if (tileLocation.IsNull())
{
RemoveFromQueue();
return;
@ -3550,7 +3550,7 @@ static uint8_t peep_get_waypointed_seat_location(
static void peep_update_ride_leave_entrance_waypoints(Peep* peep, Ride* ride)
{
TileCoordsXYZD entranceLocation = ride_get_entrance_location(ride, peep->CurrentRideStation);
Guard::Assert(!entranceLocation.isNull());
Guard::Assert(!entranceLocation.IsNull());
uint8_t direction_entrance = entranceLocation.direction;
CoordsXY waypoint = ride->stations[peep->CurrentRideStation].Start.ToTileCentre();
@ -3632,7 +3632,7 @@ void Guest::UpdateRideAdvanceThroughEntrance()
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_NO_VEHICLES))
{
auto entranceLocation = ride_get_entrance_location(ride, CurrentRideStation).ToCoordsXYZD();
Guard::Assert(!entranceLocation.isNull());
Guard::Assert(!entranceLocation.IsNull());
if (ride->type == RIDE_TYPE_MAZE)
{
@ -3744,7 +3744,7 @@ static void peep_go_to_ride_exit(Peep* peep, Ride* ride, int16_t x, int16_t y, i
Guard::Assert(peep->CurrentRideStation < MAX_STATIONS);
auto exit = ride_get_exit_location(ride, peep->CurrentRideStation);
Guard::Assert(!exit.isNull());
Guard::Assert(!exit.IsNull());
x = exit.x;
y = exit.y;
x *= 32;
@ -4210,7 +4210,7 @@ void Guest::UpdateRideLeaveVehicle()
}
auto exitLocation = ride_get_exit_location(ride, CurrentRideStation).ToCoordsXYZD();
Guard::Assert(!exitLocation.isNull());
Guard::Assert(!exitLocation.IsNull());
auto waypointLoc = CoordsXYZ{ ride->stations[CurrentRideStation].Start.ToTileCentre(),
exitLocation.z + ride->GetRideTypeDescriptor().Heights.PlatformHeight };

View File

@ -1400,7 +1400,7 @@ Direction peep_pathfind_choose_direction(const TileCoordsXYZ& loc, Peep* peep)
// Clear pathfinding history
TileCoordsXYZD nullPos;
nullPos.setNull();
nullPos.SetNull();
std::fill(std::begin(peep->PathfindHistory), std::end(peep->PathfindHistory), nullPos);
#if defined(DEBUG_LEVEL_1) && DEBUG_LEVEL_1
@ -1461,7 +1461,7 @@ Direction peep_pathfind_choose_direction(const TileCoordsXYZ& loc, Peep* peep)
for (auto& entry : _peepPathFindHistory)
{
entry.location.setNull();
entry.location.SetNull();
entry.direction = INVALID_DIRECTION;
}
@ -2185,7 +2185,7 @@ int32_t guest_path_finding(Guest* peep)
for (StationIndex stationNum = 0; stationNum < MAX_STATIONS; ++stationNum)
{
// Skip if stationNum has no entrance (so presumably an exit only station)
if (ride_get_entrance_location(ride, stationNum).isNull())
if (ride_get_entrance_location(ride, stationNum).IsNull())
continue;
numEntranceStations++;
@ -2303,7 +2303,7 @@ void Peep::ResetPathfindGoal()
}
#endif // defined(DEBUG_LEVEL_1) && DEBUG_LEVEL_1
PathfindGoal.setNull();
PathfindGoal.SetNull();
PathfindGoal.direction = INVALID_DIRECTION;
}

View File

@ -712,7 +712,7 @@ Direction Staff::MechanicDirectionSurface() const
if (ride != nullptr && (State == PeepState::Answering || State == PeepState::HeadingToInspection) && (scenario_rand() & 1))
{
auto location = ride_get_exit_location(ride, CurrentRideStation);
if (location.isNull())
if (location.IsNull())
{
location = ride_get_entrance_location(ride, CurrentRideStation);
}
@ -793,12 +793,12 @@ Direction Staff::MechanicDirectionPath(uint8_t validDirections, PathElement* pat
/* Find location of the exit for the target ride station
* or if the ride has no exit, the entrance. */
TileCoordsXYZD location = ride_get_exit_location(ride, CurrentRideStation);
if (location.isNull())
if (location.IsNull())
{
location = ride_get_entrance_location(ride, CurrentRideStation);
// If no entrance is present either. This is an incorrect state.
if (location.isNull())
if (location.IsNull())
{
return MechanicDirectionPathRand(pathDirections);
}
@ -1380,7 +1380,7 @@ void Staff::UpdateHeadingToInspect()
return;
}
if (ride_get_exit_location(ride, CurrentRideStation).isNull())
if (ride_get_exit_location(ride, CurrentRideStation).IsNull())
{
ride->lifecycle_flags &= ~RIDE_LIFECYCLE_DUE_INSPECTION;
SetState(PeepState::Falling);
@ -1435,7 +1435,7 @@ void Staff::UpdateHeadingToInspect()
if (pathingResult & PATHING_RIDE_ENTRANCE)
{
if (!ride_get_exit_location(ride, exit_index).isNull())
if (!ride_get_exit_location(ride, exit_index).IsNull())
{
return;
}
@ -1542,7 +1542,7 @@ void Staff::UpdateAnswering()
if (pathingResult & PATHING_RIDE_ENTRANCE)
{
if (!ride_get_exit_location(ride, exit_index).isNull())
if (!ride_get_exit_location(ride, exit_index).IsNull())
{
return;
}
@ -2275,7 +2275,7 @@ bool Staff::UpdateFixingMoveToStationEnd(bool firstRun, const Ride* ride)
}
auto stationPos = ride->stations[CurrentRideStation].GetStart();
if (stationPos.isNull())
if (stationPos.IsNull())
{
return true;
}
@ -2361,7 +2361,7 @@ bool Staff::UpdateFixingMoveToStationStart(bool firstRun, const Ride* ride)
}
auto stationPosition = ride->stations[CurrentRideStation].GetStart();
if (stationPosition.isNull())
if (stationPosition.IsNull())
{
return true;
}
@ -2505,11 +2505,11 @@ bool Staff::UpdateFixingMoveToStationExit(bool firstRun, const Ride* ride)
if (!firstRun)
{
auto stationPosition = ride_get_exit_location(ride, CurrentRideStation).ToCoordsXY();
if (stationPosition.isNull())
if (stationPosition.IsNull())
{
stationPosition = ride_get_entrance_location(ride, CurrentRideStation).ToCoordsXY();
if (stationPosition.isNull())
if (stationPosition.IsNull())
{
return true;
}
@ -2587,11 +2587,11 @@ bool Staff::UpdateFixingLeaveByEntranceExit(bool firstRun, const Ride* ride)
if (!firstRun)
{
auto exitPosition = ride_get_exit_location(ride, CurrentRideStation).ToCoordsXY();
if (exitPosition.isNull())
if (exitPosition.IsNull())
{
exitPosition = ride_get_entrance_location(ride, CurrentRideStation).ToCoordsXY();
if (exitPosition.isNull())
if (exitPosition.IsNull())
{
SetState(PeepState::Falling);
return false;

View File

@ -773,9 +773,9 @@ namespace RCT1
}
// Station
if (src->overall_view.isNull())
if (src->overall_view.IsNull())
{
dst->overall_view.setNull();
dst->overall_view.SetNull();
}
else
{
@ -784,9 +784,9 @@ namespace RCT1
for (int32_t i = 0; i < RCT12_MAX_STATIONS_PER_RIDE; i++)
{
if (src->station_starts[i].isNull())
if (src->station_starts[i].IsNull())
{
dst->stations[i].Start.setNull();
dst->stations[i].Start.SetNull();
}
else
{
@ -800,13 +800,13 @@ namespace RCT1
dst->stations[i].TrainAtStation = src->station_depart[i];
// Direction is fixed later.
if (src->entrance[i].isNull())
if (src->entrance[i].IsNull())
ride_clear_entrance_location(dst, i);
else
ride_set_entrance_location(
dst, i, { src->entrance[i].x, src->entrance[i].y, src->station_height[i] / 2, 0 });
if (src->exit[i].isNull())
if (src->exit[i].IsNull())
ride_clear_exit_location(dst, i);
else
ride_set_exit_location(dst, i, { src->exit[i].x, src->exit[i].y, src->station_height[i] / 2, 0 });
@ -821,7 +821,7 @@ namespace RCT1
// All other values take 0 as their default. Since they're already memset to that, no need to do it again.
for (int32_t i = RCT12_MAX_STATIONS_PER_RIDE; i < MAX_STATIONS; i++)
{
dst->stations[i].Start.setNull();
dst->stations[i].Start.SetNull();
dst->stations[i].TrainAtStation = RideStation::NO_TRAIN;
ride_clear_entrance_location(dst, i);
ride_clear_exit_location(dst, i);
@ -951,9 +951,9 @@ namespace RCT1
src->chairlift_bullwheel_z[i] / 2 };
}
if (src->cur_test_track_location.isNull())
if (src->cur_test_track_location.IsNull())
{
dst->CurTestTrackLocation.setNull();
dst->CurTestTrackLocation.SetNull();
}
else
{
@ -2748,9 +2748,9 @@ namespace RCT1
dst->TrackSubposition = VehicleTrackSubposition{ src->TrackSubposition };
dst->TrackLocation = { src->track_x, src->track_y, src->track_z };
dst->current_station = src->current_station;
if (src->boat_location.isNull() || ride->mode != RideMode::BoatHire || statusSrc != ::Vehicle::Status::TravellingBoat)
if (src->boat_location.IsNull() || ride->mode != RideMode::BoatHire || statusSrc != ::Vehicle::Status::TravellingBoat)
{
dst->BoatLocation.setNull();
dst->BoatLocation.SetNull();
dst->SetTrackDirection(src->GetTrackDirection());
dst->SetTrackType(RCT1TrackTypeToOpenRCT2(src->GetTrackType(), ride->type));
}

View File

@ -199,12 +199,12 @@ struct RCT12xy8
uint16_t xy;
};
bool isNull() const
bool IsNull() const
{
return xy == RCT12_XY8_UNDEFINED;
}
void setNull()
void SetNull()
{
xy = RCT12_XY8_UNDEFINED;
}

View File

@ -670,9 +670,9 @@ void S6Exporter::ExportRide(rct2_ride* dst, const Ride* src)
dst->name_arguments_number = src->default_name_number;
}
if (src->overall_view.isNull())
if (src->overall_view.IsNull())
{
dst->overall_view.setNull();
dst->overall_view.SetNull();
}
else
{
@ -682,9 +682,9 @@ void S6Exporter::ExportRide(rct2_ride* dst, const Ride* src)
for (int32_t i = 0; i < RCT12_MAX_STATIONS_PER_RIDE; i++)
{
if (src->stations[i].Start.isNull())
if (src->stations[i].Start.IsNull())
{
dst->station_starts[i].setNull();
dst->station_starts[i].SetNull();
}
else
{
@ -697,14 +697,14 @@ void S6Exporter::ExportRide(rct2_ride* dst, const Ride* src)
dst->train_at_station[i] = src->stations[i].TrainAtStation;
TileCoordsXYZD entrance = ride_get_entrance_location(src, i);
if (entrance.isNull())
dst->entrances[i].setNull();
if (entrance.IsNull())
dst->entrances[i].SetNull();
else
dst->entrances[i] = { static_cast<uint8_t>(entrance.x), static_cast<uint8_t>(entrance.y) };
TileCoordsXYZD exit = ride_get_exit_location(src, i);
if (exit.isNull())
dst->exits[i].setNull();
if (exit.IsNull())
dst->exits[i].SetNull();
else
dst->exits[i] = { static_cast<uint8_t>(exit.x), static_cast<uint8_t>(exit.y) };
@ -760,9 +760,9 @@ void S6Exporter::ExportRide(rct2_ride* dst, const Ride* src)
// pad_106[0x2];
dst->testing_flags = src->testing_flags;
if (src->CurTestTrackLocation.isNull())
if (src->CurTestTrackLocation.IsNull())
{
dst->cur_test_track_location.setNull();
dst->cur_test_track_location.SetNull();
}
else
{
@ -1230,9 +1230,9 @@ template<> void S6Exporter::ExportEntity(RCT2SpriteVehicle* dst, const Vehicle*
dst->track_progress = src->track_progress;
if (ride != nullptr && ride->mode == RideMode::BoatHire && src->status == Vehicle::Status::TravellingBoat)
{
if (src->BoatLocation.isNull())
if (src->BoatLocation.IsNull())
{
dst->boat_location.setNull();
dst->boat_location.SetNull();
}
else
{
@ -1473,7 +1473,7 @@ void S6Exporter::ExportEntityPeep(RCT2SpritePeep* dst, const Peep* src)
dst->id = src->Id;
dst->path_check_optimisation = src->PathCheckOptimisation;
dst->peep_flags = src->PeepFlags;
if (src->PathfindGoal.isNull())
if (src->PathfindGoal.IsNull())
{
dst->pathfind_goal = { 0xFF, 0xFF, 0xFF, INVALID_DIRECTION };
}
@ -1484,7 +1484,7 @@ void S6Exporter::ExportEntityPeep(RCT2SpritePeep* dst, const Peep* src)
}
for (size_t i = 0; i < std::size(src->PathfindHistory); i++)
{
if (src->PathfindHistory[i].isNull())
if (src->PathfindHistory[i].IsNull())
{
dst->pathfind_history[i] = { 0xFF, 0xFF, 0xFF, INVALID_DIRECTION };
}

View File

@ -582,9 +582,9 @@ public:
dst->default_name_number = src->name_arguments_number;
}
if (src->overall_view.isNull())
if (src->overall_view.IsNull())
{
dst->overall_view.setNull();
dst->overall_view.SetNull();
}
else
{
@ -594,9 +594,9 @@ public:
for (int32_t i = 0; i < RCT12_MAX_STATIONS_PER_RIDE; i++)
{
if (src->station_starts[i].isNull())
if (src->station_starts[i].IsNull())
{
dst->stations[i].Start.setNull();
dst->stations[i].Start.SetNull();
}
else
{
@ -609,12 +609,12 @@ public:
dst->stations[i].TrainAtStation = src->train_at_station[i];
// Direction is fixed later.
if (src->entrances[i].isNull())
if (src->entrances[i].IsNull())
ride_clear_entrance_location(dst, i);
else
ride_set_entrance_location(dst, i, { src->entrances[i].x, src->entrances[i].y, src->station_heights[i], 0 });
if (src->exits[i].isNull())
if (src->exits[i].IsNull())
ride_clear_exit_location(dst, i);
else
ride_set_exit_location(dst, i, { src->exits[i].x, src->exits[i].y, src->station_heights[i], 0 });
@ -631,7 +631,7 @@ public:
// All other values take 0 as their default. Since they're already memset to that, no need to do it again.
for (int32_t i = RCT12_MAX_STATIONS_PER_RIDE; i < MAX_STATIONS; i++)
{
dst->stations[i].Start.setNull();
dst->stations[i].Start.SetNull();
dst->stations[i].TrainAtStation = RideStation::NO_TRAIN;
ride_clear_entrance_location(dst, i);
ride_clear_exit_location(dst, i);
@ -683,9 +683,9 @@ public:
// pad_106[0x2];
dst->testing_flags = src->testing_flags;
if (src->cur_test_track_location.isNull())
if (src->cur_test_track_location.IsNull())
{
dst->CurTestTrackLocation.setNull();
dst->CurTestTrackLocation.SetNull();
}
else
{
@ -1445,7 +1445,7 @@ public:
dst->PeepFlags = src->peep_flags;
if (isNullLocation(src->pathfind_goal))
{
dst->PathfindGoal.setNull();
dst->PathfindGoal.SetNull();
dst->PathfindGoal.direction = INVALID_DIRECTION;
}
else
@ -1457,7 +1457,7 @@ public:
{
if (isNullLocation(src->pathfind_history[i]))
{
dst->PathfindHistory[i].setNull();
dst->PathfindHistory[i].SetNull();
dst->PathfindHistory[i].direction = INVALID_DIRECTION;
}
else
@ -1602,10 +1602,10 @@ template<> void S6Importer::ImportEntity<Vehicle>(const RCT12SpriteBase& baseSrc
dst->colours = src->colours;
dst->track_progress = src->track_progress;
dst->TrackLocation = { src->track_x, src->track_y, src->track_z };
if (src->boat_location.isNull() || static_cast<RideMode>(ride.mode) != RideMode::BoatHire
if (src->boat_location.IsNull() || static_cast<RideMode>(ride.mode) != RideMode::BoatHire
|| src->status != static_cast<uint8_t>(Vehicle::Status::TravellingBoat))
{
dst->BoatLocation.setNull();
dst->BoatLocation.SetNull();
dst->SetTrackDirection(src->GetTrackDirection());
dst->SetTrackType(src->GetTrackType());
// RotationControlToggle and Booster are saved as the same track piece ID

View File

@ -77,7 +77,7 @@ Vehicle* cable_lift_segment_create(
current->SetState(Vehicle::Status::MovingToEndOfStation, 0);
current->num_peeps = 0;
current->next_free_seat = 0;
current->BoatLocation.setNull();
current->BoatLocation.SetNull();
current->IsCrashedVehicle = false;
return current;
}

View File

@ -251,7 +251,7 @@ int32_t Ride::GetTotalQueueLength() const
{
int32_t i, queueLength = 0;
for (i = 0; i < MAX_STATIONS; i++)
if (!ride_get_entrance_location(this, i).isNull())
if (!ride_get_entrance_location(this, i).IsNull())
queueLength += stations[i].QueueLength;
return queueLength;
}
@ -260,7 +260,7 @@ int32_t Ride::GetMaxQueueTime() const
{
uint8_t i, queueTime = 0;
for (i = 0; i < MAX_STATIONS; i++)
if (!ride_get_entrance_location(this, i).isNull())
if (!ride_get_entrance_location(this, i).IsNull())
queueTime = std::max(queueTime, stations[i].QueueTime);
return static_cast<int32_t>(queueTime);
}
@ -1166,7 +1166,7 @@ void Ride::UpdateSpiralSlide()
// Invalidate something related to station start
for (int32_t i = 0; i < MAX_STATIONS; i++)
{
if (stations[i].Start.isNull())
if (stations[i].Start.IsNull())
continue;
auto startLoc = stations[i].Start;
@ -1647,10 +1647,10 @@ Staff* ride_find_closest_mechanic(Ride* ride, int32_t forInspection)
// Get either exit position or entrance position if there is no exit
auto stationIndex = ride->inspection_station;
TileCoordsXYZD location = ride_get_exit_location(ride, stationIndex);
if (location.isNull())
if (location.IsNull())
{
location = ride_get_entrance_location(ride, stationIndex);
if (location.isNull())
if (location.IsNull())
return nullptr;
}
@ -2155,7 +2155,7 @@ void ride_check_all_reachable()
*/
static bool ride_entrance_exit_is_reachable(const TileCoordsXYZD& coordinates)
{
if (coordinates.isNull())
if (coordinates.IsNull())
return true;
TileCoordsXYZ loc{ coordinates.x, coordinates.y, coordinates.z };
@ -2172,9 +2172,9 @@ static void ride_entrance_exit_connected(Ride* ride)
auto entrance = ride_get_entrance_location(ride, i);
auto exit = ride_get_exit_location(ride, i);
if (station_start.isNull())
if (station_start.IsNull())
continue;
if (!entrance.isNull() && !ride_entrance_exit_is_reachable(entrance))
if (!entrance.IsNull() && !ride_entrance_exit_is_reachable(entrance))
{
// name of ride is parameter of the format string
Formatter ft;
@ -2186,7 +2186,7 @@ static void ride_entrance_exit_connected(Ride* ride)
ride->connected_message_throttle = 3;
}
if (!exit.isNull() && !ride_entrance_exit_is_reachable(exit))
if (!exit.IsNull() && !ride_entrance_exit_is_reachable(exit))
{
// name of ride is parameter of the format string
Formatter ft;
@ -2203,7 +2203,7 @@ static void ride_entrance_exit_connected(Ride* ride)
static void ride_shop_connected(Ride* ride)
{
auto shopLoc = TileCoordsXY(ride->stations[0].Start);
if (shopLoc.isNull())
if (shopLoc.IsNull())
return;
TrackElement* trackElement = nullptr;
@ -2312,7 +2312,7 @@ static void ride_station_set_map_tooltip(TileElement* tileElement)
{
auto stationIndex = tileElement->AsTrack()->GetStationIndex();
for (int32_t i = stationIndex; i >= 0; i--)
if (ride->stations[i].Start.isNull())
if (ride->stations[i].Start.IsNull())
stationIndex--;
auto ft = Formatter();
@ -2337,14 +2337,14 @@ static void ride_entrance_set_map_tooltip(TileElement* tileElement)
// Get the station
auto stationIndex = tileElement->AsEntrance()->GetStationIndex();
for (int32_t i = stationIndex; i >= 0; i--)
if (ride->stations[i].Start.isNull())
if (ride->stations[i].Start.IsNull())
stationIndex--;
if (tileElement->AsEntrance()->GetEntranceType() == ENTRANCE_TYPE_RIDE_ENTRANCE)
{
// Get the queue length
int32_t queueLength = 0;
if (!ride_get_entrance_location(ride, stationIndex).isNull())
if (!ride_get_entrance_location(ride, stationIndex).IsNull())
queueLength = ride->stations[stationIndex].QueueLength;
auto ft = Formatter();
@ -2378,7 +2378,7 @@ static void ride_entrance_set_map_tooltip(TileElement* tileElement)
// Get the station
stationIndex = tileElement->AsEntrance()->GetStationIndex();
for (int32_t i = stationIndex; i >= 0; i--)
if (ride->stations[i].Start.isNull())
if (ride->stations[i].Start.IsNull())
stationIndex--;
auto ft = Formatter();
@ -2430,7 +2430,7 @@ static StationIndex ride_mode_check_valid_station_numbers(Ride* ride)
uint16_t numStations = 0;
for (StationIndex stationIndex = 0; stationIndex < MAX_STATIONS; ++stationIndex)
{
if (!ride->stations[stationIndex].Start.isNull())
if (!ride->stations[stationIndex].Start.IsNull())
{
numStations++;
}
@ -2510,22 +2510,22 @@ static int32_t ride_check_for_entrance_exit(ride_id_t rideIndex)
uint8_t exit = 0;
for (int32_t i = 0; i < MAX_STATIONS; i++)
{
if (ride->stations[i].Start.isNull())
if (ride->stations[i].Start.IsNull())
continue;
if (!ride_get_entrance_location(ride, i).isNull())
if (!ride_get_entrance_location(ride, i).IsNull())
{
entrance = 1;
}
if (!ride_get_exit_location(ride, i).isNull())
if (!ride_get_exit_location(ride, i).IsNull())
{
exit = 1;
}
// If station start and no entrance/exit
// Sets same error message as no entrance
if (ride_get_exit_location(ride, i).isNull() && ride_get_entrance_location(ride, i).isNull())
if (ride_get_exit_location(ride, i).IsNull() && ride_get_entrance_location(ride, i).IsNull())
{
entrance = 0;
break;
@ -2556,7 +2556,7 @@ void Ride::ChainQueues() const
for (int32_t i = 0; i < MAX_STATIONS; i++)
{
auto location = ride_get_entrance_location(this, i);
if (location.isNull())
if (location.IsNull())
continue;
auto mapLocation = location.ToCoordsXYZ();
@ -2892,19 +2892,19 @@ static void ride_set_maze_entrance_exit_points(Ride* ride)
const auto entrance = ride_get_entrance_location(ride, i);
const auto exit = ride_get_exit_location(ride, i);
if (!entrance.isNull())
if (!entrance.IsNull())
{
*position++ = entrance;
}
if (!exit.isNull())
if (!exit.IsNull())
{
*position++ = exit;
}
}
(*position++).setNull();
(*position++).SetNull();
// Enumerate entrance and exit positions
for (position = positions; !(*position).isNull(); position++)
for (position = positions; !(*position).IsNull(); position++)
{
auto entranceExitMapPos = position->ToCoordsXYZ();
@ -3211,7 +3211,7 @@ static Vehicle* vehicle_create_car(
// loc_6DDD5E:
vehicle->num_peeps = 0;
vehicle->next_free_seat = 0;
vehicle->BoatLocation.setNull();
vehicle->BoatLocation.SetNull();
vehicle->IsCrashedVehicle = false;
return vehicle;
}
@ -3525,7 +3525,7 @@ static bool ride_initialise_cable_lift_track(Ride* ride, bool isApplying)
for (StationIndex stationIndex = 0; stationIndex < MAX_STATIONS; stationIndex++)
{
location = ride->stations[stationIndex].GetStart();
if (!location.isNull())
if (!location.IsNull())
break;
if (stationIndex == (MAX_STATIONS - 1))
{
@ -3709,16 +3709,16 @@ void Ride::ConstructMissingEntranceOrExit() const
int32_t i;
for (i = 0; i < MAX_STATIONS; i++)
{
if (stations[i].Start.isNull())
if (stations[i].Start.IsNull())
continue;
if (ride_get_entrance_location(this, i).isNull())
if (ride_get_entrance_location(this, i).IsNull())
{
entranceOrExit = WC_RIDE_CONSTRUCTION__WIDX_ENTRANCE;
break;
}
if (ride_get_exit_location(this, i).isNull())
if (ride_get_exit_location(this, i).IsNull())
{
entranceOrExit = WC_RIDE_CONSTRUCTION__WIDX_EXIT;
break;
@ -4848,7 +4848,7 @@ static std::optional<int32_t> ride_get_smallest_station_length(Ride* ride)
std::optional<int32_t> result;
for (const auto& station : ride->stations)
{
if (!station.Start.isNull())
if (!station.Start.IsNull())
{
if (!result.has_value() || station.Length < *result)
{
@ -4873,7 +4873,7 @@ static int32_t ride_get_track_length(Ride* ride)
for (int32_t i = 0; i < MAX_STATIONS && !foundTrack; i++)
{
trackStart = ride->stations[i].GetStart();
if (trackStart.isNull())
if (trackStart.IsNull())
continue;
tileElement = map_get_first_element_at(trackStart);
@ -5334,7 +5334,7 @@ bool ride_has_adjacent_station(Ride* ride)
for (StationIndex stationNum = 0; stationNum < MAX_STATIONS; stationNum++)
{
auto stationStart = ride->stations[stationNum].GetStart();
if (!stationStart.isNull())
if (!stationStart.IsNull())
{
/* Get the map element for the station start. */
TileElement* stationElement = get_station_platform({ stationStart, stationStart.z + 0 });
@ -5509,7 +5509,7 @@ void determine_ride_entrance_and_exit_locations()
bool fixExit = false;
// Skip if the station has no entrance
if (!entranceLoc.isNull())
if (!entranceLoc.IsNull())
{
const EntranceElement* entranceElement = map_get_ride_entrance_element_at(entranceLoc.ToCoordsXYZD(), false);
@ -5524,7 +5524,7 @@ void determine_ride_entrance_and_exit_locations()
}
}
if (!exitLoc.isNull())
if (!exitLoc.IsNull())
{
const EntranceElement* entranceElement = map_get_ride_exit_element_at(exitLoc.ToCoordsXYZD(), false);

View File

@ -258,7 +258,7 @@ void ride_remove_peeps(Ride* ride)
if (stationIndex != STATION_INDEX_NULL)
{
auto location = ride_get_exit_location(ride, stationIndex).ToCoordsXYZD();
if (!location.isNull())
if (!location.IsNull())
{
auto direction = direction_reverse(location.direction);
exitPosition = location;
@ -1274,7 +1274,7 @@ CoordsXYZD ride_get_entrance_or_exit_position_from_screen_position(const ScreenC
auto ride = get_ride(gRideEntranceExitPlaceRideIndex);
if (ride == nullptr)
{
entranceExitCoords.setNull();
entranceExitCoords.SetNull();
return entranceExitCoords;
}
@ -1283,7 +1283,7 @@ CoordsXYZD ride_get_entrance_or_exit_position_from_screen_position(const ScreenC
auto coordsAtHeight = screen_get_map_xy_with_z(screenCoords, stationBaseZ);
if (!coordsAtHeight)
{
entranceExitCoords.setNull();
entranceExitCoords.SetNull();
return entranceExitCoords;
}
@ -1291,14 +1291,14 @@ CoordsXYZD ride_get_entrance_or_exit_position_from_screen_position(const ScreenC
if (ride->type == RIDE_TYPE_NULL)
{
entranceExitCoords.setNull();
entranceExitCoords.SetNull();
return entranceExitCoords;
}
auto stationStart = ride->stations[gRideEntranceExitPlaceStationIndex].Start;
if (stationStart.isNull())
if (stationStart.IsNull())
{
entranceExitCoords.setNull();
entranceExitCoords.SetNull();
return entranceExitCoords;
}
@ -1377,7 +1377,7 @@ CoordsXYZD ride_get_entrance_or_exit_position_from_screen_position(const ScreenC
auto tileElement = ride_get_station_start_track_element(ride, gRideEntranceExitPlaceStationIndex);
if (tileElement == nullptr)
{
entranceExitCoords.setNull();
entranceExitCoords.SetNull();
return entranceExitCoords;
}
auto stationDirection = tileElement->GetDirection();
@ -1443,7 +1443,7 @@ void Ride::ValidateStations()
// find the stations of the ride to begin stepping over track elements from
for (StationIndex stationId = 0; stationId < MAX_STATIONS; ++stationId)
{
if (stations[stationId].Start.isNull())
if (stations[stationId].Start.IsNull())
continue;
CoordsXYZ location = stations[stationId].GetStart();
@ -1550,14 +1550,14 @@ void Ride::ValidateStations()
for (StationIndex stationId = 0; stationId < MAX_STATIONS; ++stationId)
{
auto entrance = ride_get_entrance_location(this, stationId);
if (!entrance.isNull())
if (!entrance.IsNull())
{
locations.push_back(entrance);
ride_clear_entrance_location(this, stationId);
}
auto exit = ride_get_exit_location(this, stationId);
if (!exit.isNull())
if (!exit.IsNull())
{
locations.push_back(exit);
ride_clear_exit_location(this, stationId);
@ -1645,7 +1645,7 @@ void Ride::ValidateStations()
if (tileElement->AsEntrance()->GetEntranceType() == ENTRANCE_TYPE_RIDE_EXIT)
{
// if the location is already set for this station, big problem!
if (!ride_get_exit_location(this, stationId).isNull())
if (!ride_get_exit_location(this, stationId).IsNull())
break;
// set the station's exit location to this one
CoordsXYZD loc = { location, stations[stationId].GetBaseZ(), tileElement->GetDirection() };
@ -1654,7 +1654,7 @@ void Ride::ValidateStations()
else
{
// if the location is already set for this station, big problem!
if (!ride_get_entrance_location(this, stationId).isNull())
if (!ride_get_entrance_location(this, stationId).IsNull())
break;
// set the station's entrance location to this one
CoordsXYZD loc = { location, stations[stationId].GetBaseZ(), tileElement->GetDirection() };
@ -1738,16 +1738,16 @@ bool ride_are_all_possible_entrances_and_exits_built(Ride* ride)
for (int32_t i = 0; i < MAX_STATIONS; i++)
{
if (ride->stations[i].Start.isNull())
if (ride->stations[i].Start.IsNull())
{
continue;
}
if (ride_get_entrance_location(ride, i).isNull())
if (ride_get_entrance_location(ride, i).IsNull())
{
gGameCommandErrorText = STR_ENTRANCE_NOT_YET_BUILT;
return false;
}
if (ride_get_exit_location(ride, i).isNull())
if (ride_get_exit_location(ride, i).IsNull())
{
gGameCommandErrorText = STR_EXIT_NOT_YET_BUILT;
return false;

View File

@ -237,7 +237,7 @@ static void ride_ratings_update_state_2(RideRatingUpdateState& state)
{
int32_t entranceIndex = tileElement->AsTrack()->GetStationIndex();
state.StationFlags &= ~RIDE_RATING_STATION_FLAG_NO_ENTRANCE;
if (ride_get_entrance_location(ride, entranceIndex).isNull())
if (ride_get_entrance_location(ride, entranceIndex).IsNull())
{
state.StationFlags |= RIDE_RATING_STATION_FLAG_NO_ENTRANCE;
}
@ -386,10 +386,10 @@ static void ride_ratings_begin_proximity_loop(RideRatingUpdateState& state)
for (int32_t i = 0; i < MAX_STATIONS; i++)
{
if (!ride->stations[i].Start.isNull())
if (!ride->stations[i].Start.IsNull())
{
state.StationFlags &= ~RIDE_RATING_STATION_FLAG_NO_ENTRANCE;
if (ride_get_entrance_location(ride, i).isNull())
if (ride_get_entrance_location(ride, i).IsNull())
{
state.StationFlags |= RIDE_RATING_STATION_FLAG_NO_ENTRANCE;
}

View File

@ -29,7 +29,7 @@ static void ride_invalidate_station_start(Ride* ride, StationIndex stationIndex,
*/
void ride_update_station(Ride* ride, StationIndex stationIndex)
{
if (ride->stations[stationIndex].Start.isNull())
if (ride->stations[stationIndex].Start.IsNull())
return;
switch (ride->mode)
@ -367,7 +367,7 @@ StationIndex ride_get_first_valid_station_exit(Ride* ride)
{
for (StationIndex i = 0; i < MAX_STATIONS; i++)
{
if (!ride->stations[i].Exit.isNull())
if (!ride->stations[i].Exit.IsNull())
{
return i;
}
@ -379,7 +379,7 @@ StationIndex ride_get_first_valid_station_start(const Ride* ride)
{
for (StationIndex i = 0; i < MAX_STATIONS; i++)
{
if (!ride->stations[i].Start.isNull())
if (!ride->stations[i].Start.IsNull())
{
return i;
}
@ -391,7 +391,7 @@ StationIndex ride_get_first_empty_station_start(const Ride* ride)
{
for (StationIndex i = 0; i < MAX_STATIONS; i++)
{
if (ride->stations[i].Start.isNull())
if (ride->stations[i].Start.IsNull())
{
return i;
}
@ -411,12 +411,12 @@ TileCoordsXYZD ride_get_exit_location(const Ride* ride, const StationIndex stati
void ride_clear_entrance_location(Ride* ride, const StationIndex stationIndex)
{
ride->stations[stationIndex].Entrance.setNull();
ride->stations[stationIndex].Entrance.SetNull();
}
void ride_clear_exit_location(Ride* ride, const StationIndex stationIndex)
{
ride->stations[stationIndex].Exit.setNull();
ride->stations[stationIndex].Exit.SetNull();
}
void ride_set_entrance_location(Ride* ride, const StationIndex stationIndex, const TileCoordsXYZD& location)

View File

@ -100,7 +100,7 @@ static void ride_remove_station(Ride* ride, const CoordsXYZ& location)
auto stationStart = ride->stations[i].GetStart();
if (stationStart == location)
{
ride->stations[i].Start.setNull();
ride->stations[i].Start.SetNull();
ride->num_stations--;
break;
}

View File

@ -265,7 +265,7 @@ rct_string_id TrackDesign::CreateTrackDesignTrack(const Ride& ride)
location = ride_get_exit_location(&ride, station_index);
}
if (location.isNull())
if (location.IsNull())
{
continue;
}
@ -379,7 +379,7 @@ rct_string_id TrackDesign::CreateTrackDesignMaze(const Ride& ride)
}
auto location = ride_get_entrance_location(&ride, 0);
if (location.isNull())
if (location.IsNull())
{
return STR_TRACK_TOO_LARGE_OR_TOO_MUCH_SCENERY;
}
@ -408,7 +408,7 @@ rct_string_id TrackDesign::CreateTrackDesignMaze(const Ride& ride)
maze_elements.push_back(mazeEntrance);
location = ride_get_exit_location(&ride, 0);
if (location.isNull())
if (location.IsNull())
{
return STR_TRACK_TOO_LARGE_OR_TOO_MUCH_SCENERY;
}

View File

@ -1607,7 +1607,7 @@ void Vehicle::UpdateMeasurements()
if (curRide->current_test_station == STATION_INDEX_NULL)
return;
if (!ride_get_entrance_location(curRide, curRide->current_test_station).isNull())
if (!ride_get_entrance_location(curRide, curRide->current_test_station).IsNull())
{
uint8_t test_segment = curRide->current_test_segment;
@ -1666,7 +1666,7 @@ void Vehicle::UpdateMeasurements()
{
curRide->CurTestTrackLocation = curTrackLoc;
if (ride_get_entrance_location(curRide, curRide->current_test_station).isNull())
if (ride_get_entrance_location(curRide, curRide->current_test_station).IsNull())
return;
auto trackElemType = GetTrackType();
@ -1882,7 +1882,7 @@ void Vehicle::UpdateMeasurements()
}
}
if (ride_get_entrance_location(curRide, curRide->current_test_station).isNull())
if (ride_get_entrance_location(curRide, curRide->current_test_station).IsNull())
return;
if (x == LOCATION_NULL)
@ -2332,7 +2332,7 @@ void Vehicle::UpdateWaitingForPassengers()
if (!OpenRestraints())
return;
if (ride_get_entrance_location(curRide, current_station).isNull())
if (ride_get_entrance_location(curRide, current_station).IsNull())
{
curRide->stations[current_station].TrainAtStation = RideStation::NO_TRAIN;
sub_state = 2;
@ -2568,7 +2568,7 @@ void Vehicle::UpdateWaitingToDepart()
}
else
{
if (!ride_get_exit_location(curRide, current_station).isNull())
if (!ride_get_exit_location(curRide, current_station).IsNull())
{
SetState(Vehicle::Status::UnloadingPassengers);
return;
@ -2582,7 +2582,7 @@ void Vehicle::UpdateWaitingToDepart()
{
if (trainCar->num_peeps != 0)
{
if (!ride_get_exit_location(curRide, current_station).isNull())
if (!ride_get_exit_location(curRide, current_station).IsNull())
{
SetState(Vehicle::Status::UnloadingPassengers);
return;
@ -3144,7 +3144,7 @@ static void test_reset(Ride& ride, StationIndex curStation)
ride.previous_vertical_g = 0;
ride.previous_lateral_g = 0;
ride.testing_flags = 0;
ride.CurTestTrackLocation.setNull();
ride.CurTestTrackLocation.SetNull();
ride.turn_count_default = 0;
ride.turn_count_banked = 0;
ride.turn_count_sloped = 0;
@ -4200,7 +4200,7 @@ void Vehicle::UpdateUnloadingPassengers()
}
else
{
if (ride_get_exit_location(curRide, current_station).isNull())
if (ride_get_exit_location(curRide, current_station).IsNull())
{
if (sub_state != 1)
return;
@ -4388,7 +4388,7 @@ void Vehicle::TryReconnectBoatToTrack(const CoordsXY& currentBoatLocation, const
{
SetTrackType(trackElement->GetTrackType());
SetTrackDirection(curRide->boat_hire_return_direction);
BoatLocation.setNull();
BoatLocation.SetNull();
}
track_progress = 0;

View File

@ -341,7 +341,7 @@ namespace OpenRCT2::Scripting
template<> inline DukValue ToDuk(duk_context* ctx, const CoordsXYZ& value)
{
if (value.isNull())
if (value.IsNull())
{
return ToDuk(ctx, nullptr);
}
@ -366,14 +366,14 @@ namespace OpenRCT2::Scripting
}
else
{
result.setNull();
result.SetNull();
}
return result;
}
template<> inline DukValue ToDuk(duk_context* ctx, const CoordsXYZD& value)
{
if (value.isNull())
if (value.IsNull())
{
return ToDuk(ctx, nullptr);
}
@ -408,7 +408,7 @@ namespace OpenRCT2::Scripting
}
else
{
result.setNull();
result.SetNull();
}
return result;
}

View File

@ -878,7 +878,7 @@ DukValue ScriptEngine::GameActionResultToDuk(const GameAction& action, const std
{
obj.Set("cost", result->Cost);
}
if (!result->Position.isNull())
if (!result->Position.IsNull())
{
obj.Set("position", ToDuk(_context, result->Position));
}

View File

@ -221,7 +221,7 @@ ride_id_t banner_get_closest_ride_index(const CoordsXYZ& mapPos)
continue;
auto rideCoords = ride.overall_view;
if (rideCoords.isNull())
if (rideCoords.IsNull())
continue;
int32_t distance = abs(mapPos.x - rideCoords.x) + abs(mapPos.y - rideCoords.y);

View File

@ -246,7 +246,7 @@ CoordsXY footpath_get_coordinates_from_pos(const ScreenCoordsXY& screenCoords, i
if (window == nullptr || window->viewport == nullptr)
{
CoordsXY position{};
position.setNull();
position.SetNull();
return position;
}
auto viewport = window->viewport;
@ -259,7 +259,7 @@ CoordsXY footpath_get_coordinates_from_pos(const ScreenCoordsXY& screenCoords, i
if (info.SpriteType == ViewportInteractionItem::None)
{
auto position = info.Loc;
position.setNull();
position.SetNull();
return position;
}
}
@ -344,7 +344,7 @@ CoordsXY footpath_bridge_get_info_from_pos(const ScreenCoordsXY& screenCoords, i
if (window == nullptr || window->viewport == nullptr)
{
CoordsXY ret{};
ret.setNull();
ret.SetNull();
return ret;
}
auto viewport = window->viewport;
@ -1221,7 +1221,7 @@ void footpath_update_queue_chains()
for (int32_t i = 0; i < MAX_STATIONS; i++)
{
TileCoordsXYZD location = ride_get_entrance_location(ride, i);
if (location.isNull())
if (location.IsNull())
continue;
TileElement* tileElement = map_get_first_element_at(location.ToCoordsXY());

View File

@ -215,12 +215,12 @@ struct CoordsXY
return { floor2(x, COORDS_XY_STEP), floor2(y, COORDS_XY_STEP) };
}
constexpr bool isNull() const
constexpr bool IsNull() const
{
return x == COORDS_NULL;
};
constexpr void setNull()
constexpr void SetNull()
{
x = COORDS_NULL;
y = 0;
@ -269,9 +269,9 @@ struct CoordsXYZ : public CoordsXY
return ToTileStart() + CoordsXYZ{ COORDS_XY_HALF_TILE, COORDS_XY_HALF_TILE, 0 };
}
constexpr void setNull()
constexpr void SetNull()
{
CoordsXY::setNull();
CoordsXY::SetNull();
z = 0;
}
};
@ -343,10 +343,10 @@ struct TileCoordsXY
constexpr CoordsXY ToCoordsXY() const
{
if (isNull())
if (IsNull())
{
CoordsXY ret{};
ret.setNull();
ret.SetNull();
return ret;
}
@ -390,12 +390,12 @@ struct TileCoordsXY
return !(*this == other);
}
constexpr bool isNull() const
constexpr bool IsNull() const
{
return x == COORDS_NULL;
};
constexpr void setNull()
constexpr void SetNull()
{
x = COORDS_NULL;
y = 0;
@ -457,18 +457,18 @@ struct TileCoordsXYZ : public TileCoordsXY
constexpr CoordsXYZ ToCoordsXYZ() const
{
if (isNull())
if (IsNull())
{
CoordsXYZ ret{};
ret.setNull();
ret.SetNull();
return ret;
}
return { x * COORDS_XY_STEP, y * COORDS_XY_STEP, z * COORDS_Z_STEP };
}
constexpr void setNull()
constexpr void SetNull()
{
TileCoordsXY::setNull();
TileCoordsXY::SetNull();
z = 0;
}
};
@ -667,18 +667,18 @@ struct TileCoordsXYZD : public TileCoordsXYZ
constexpr CoordsXYZD ToCoordsXYZD() const
{
if (isNull())
if (IsNull())
{
CoordsXYZD ret{};
ret.setNull();
ret.SetNull();
return ret;
}
return { x * COORDS_XY_STEP, y * COORDS_XY_STEP, z * COORDS_Z_STEP, direction };
}
constexpr void setNull()
constexpr void SetNull()
{
TileCoordsXYZ::setNull();
TileCoordsXYZ::SetNull();
direction = INVALID_DIRECTION;
}
};

View File

@ -66,7 +66,7 @@ void MoneyEffect::CreateAt(money64 value, const CoordsXYZ& effectPos, bool verti
void MoneyEffect::Create(money64 value, const CoordsXYZ& loc)
{
auto offsetLoc = loc;
if (loc.isNull())
if (loc.IsNull())
{
// If game actions return no valid location of the action we can not use the screen
// coordinates as every client will have different ones.