mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r17071) -Fix: give a better error message when trying to make road one-way when it doesn't belong to you
This commit is contained in:
parent
e0ba8e6b56
commit
47b111449b
|
@ -489,9 +489,12 @@ CommandCost CmdBuildRoad(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
|
||||||
}
|
}
|
||||||
if ((existing & pieces) == pieces) {
|
if ((existing & pieces) == pieces) {
|
||||||
/* We only want to set the (dis)allowed road directions */
|
/* We only want to set the (dis)allowed road directions */
|
||||||
if (toggle_drd != DRD_NONE && rt != ROADTYPE_TRAM && IsRoadOwner(tile, ROADTYPE_ROAD, _current_company)) {
|
if (toggle_drd != DRD_NONE && rt != ROADTYPE_TRAM) {
|
||||||
if (crossing) return_cmd_error(STR_ERROR_ONEWAY_ROADS_CAN_T_HAVE_JUNCTION);
|
if (crossing) return_cmd_error(STR_ERROR_ONEWAY_ROADS_CAN_T_HAVE_JUNCTION);
|
||||||
|
|
||||||
|
Owner owner = GetRoadOwner(tile, ROADTYPE_ROAD);
|
||||||
|
if (owner != OWNER_NONE && !CheckOwnership(owner)) return CMD_ERROR;
|
||||||
|
|
||||||
if (!EnsureNoVehicleOnGround(tile)) return CMD_ERROR;
|
if (!EnsureNoVehicleOnGround(tile)) return CMD_ERROR;
|
||||||
|
|
||||||
/* Ignore half built tiles */
|
/* Ignore half built tiles */
|
||||||
|
|
Loading…
Reference in New Issue