1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-18 20:43:04 +01:00

Merge pull request #15815 from ZehMatt/fix/error-proapgation

Avoid overwriting gGameCommandErrorText
This commit is contained in:
ζeh Matt
2021-10-28 15:59:23 -07:00
committed by GitHub
4 changed files with 6 additions and 9 deletions

View File

@@ -93,7 +93,7 @@ GameActions::Result::Ptr RideEntranceExitPlaceAction::Query() const
auto z = ride->stations[_stationNum].GetBaseZ();
if (!LocationValid(_loc) || (!gCheatsSandboxMode && !map_is_location_owned({ _loc, z })))
{
return MakeResult(GameActions::Status::NotOwned, errorTitle, STR_NONE);
return MakeResult(GameActions::Status::NotOwned, errorTitle, STR_LAND_NOT_OWNED_BY_PARK);
}
if (!MapCheckCapacityAndReorganise(_loc))
@@ -224,7 +224,7 @@ GameActions::Result::Ptr RideEntranceExitPlaceAction::TrackPlaceQuery(const Coor
if (!gCheatsSandboxMode && !map_is_location_owned(loc))
{
return MakeResult(GameActions::Status::NotOwned, errorTitle, STR_NONE);
return MakeResult(GameActions::Status::NotOwned, errorTitle, STR_LAND_NOT_OWNED_BY_PARK);
}
if (!MapCheckCapacityAndReorganise(loc))

View File

@@ -84,12 +84,12 @@ GameActions::Result::Ptr WallPlaceAction::Query() const
{
if (!map_is_location_in_park(_loc))
{
return MakeResult(GameActions::Status::NotOwned, STR_CANT_BUILD_THIS_HERE, STR_NONE);
return MakeResult(GameActions::Status::NotOwned, STR_CANT_BUILD_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK);
}
}
else if (!map_is_location_owned(_loc))
{
return MakeResult(GameActions::Status::NotOwned, STR_CANT_BUILD_THIS_HERE, STR_NONE);
return MakeResult(GameActions::Status::NotOwned, STR_CANT_BUILD_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK);
}
}
else if (!_trackDesignDrawingPreview && (_loc.x > GetMapSizeMaxXY() || _loc.y > GetMapSizeMaxXY()))

View File

@@ -592,7 +592,8 @@ std::unique_ptr<GameActions::Result> Peep::Place(const TileCoordsXYZ& location,
if (!map_is_location_owned(destination))
{
return std::make_unique<GameActions::Result>(GameActions::Status::NotOwned, STR_ERR_CANT_PLACE_PERSON_HERE, STR_NONE);
return std::make_unique<GameActions::Result>(
GameActions::Status::NotOwned, STR_ERR_CANT_PLACE_PERSON_HERE, STR_LAND_NOT_OWNED_BY_PARK);
}
if (auto res = MapCanConstructAt({ destination, destination.z, destination.z + (1 * 8) }, { 0b1111, 0 });

View File

@@ -786,8 +786,6 @@ bool map_is_location_owned(const CoordsXYZ& loc)
}
}
}
gGameCommandErrorText = STR_LAND_NOT_OWNED_BY_PARK;
return false;
}
@@ -805,8 +803,6 @@ bool map_is_location_in_park(const CoordsXY& coords)
if (surfaceElement->GetOwnership() & OWNERSHIP_OWNED)
return true;
}
gGameCommandErrorText = STR_LAND_NOT_OWNED_BY_PARK;
return false;
}