mirror of https://github.com/OpenRCT2/OpenRCT2.git
Refactored the goto statement
This commit is contained in:
parent
0a5b75e882
commit
6e077c42ea
|
@ -900,9 +900,9 @@ bool track_remove_station_element(int32_t x, int32_t y, int32_t z, Direction dir
|
|||
if (stationElement != nullptr)
|
||||
{
|
||||
int32_t targetTrackType;
|
||||
if (x == stationX1 && y == stationY1)
|
||||
if ((x == stationX1 && y == stationY1)
|
||||
|| (x + CoordsDirectionDelta[direction].x == removeX && y + CoordsDirectionDelta[direction].y == removeY))
|
||||
{
|
||||
loc_6C4BF5:;
|
||||
auto stationIndex = ride_get_first_empty_station_start(ride);
|
||||
if (stationIndex == STATION_INDEX_NULL)
|
||||
{
|
||||
|
@ -923,27 +923,19 @@ bool track_remove_station_element(int32_t x, int32_t y, int32_t z, Direction dir
|
|||
}
|
||||
else
|
||||
{
|
||||
if (x + CoordsDirectionDelta[direction].x == removeX && y + CoordsDirectionDelta[direction].y == removeY)
|
||||
if (x - CoordsDirectionDelta[direction].x == removeX && y - CoordsDirectionDelta[direction].y == removeY)
|
||||
{
|
||||
goto loc_6C4BF5;
|
||||
targetTrackType = TRACK_ELEM_BEGIN_STATION;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (x - CoordsDirectionDelta[direction].x == removeX
|
||||
&& y - CoordsDirectionDelta[direction].y == removeY)
|
||||
if (x == stationX0 && y == stationY0)
|
||||
{
|
||||
targetTrackType = TRACK_ELEM_BEGIN_STATION;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (x == stationX0 && y == stationY0)
|
||||
{
|
||||
targetTrackType = TRACK_ELEM_BEGIN_STATION;
|
||||
}
|
||||
else
|
||||
{
|
||||
targetTrackType = TRACK_ELEM_MIDDLE_STATION;
|
||||
}
|
||||
targetTrackType = TRACK_ELEM_MIDDLE_STATION;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue