road_cmd.c
changeset 3560 4389ae5ad967
parent 3491 4c8427796c64
child 3636 d87b21df2944
equal deleted inserted replaced
3559:1d4b8eb9b493 3560:4389ae5ad967
    45 	if (_game_mode == GM_EDITOR) return true;
    45 	if (_game_mode == GM_EDITOR) return true;
    46 
    46 
    47 	// Only do the special processing for actual players.
    47 	// Only do the special processing for actual players.
    48 	if (_current_player >= MAX_PLAYERS) return true;
    48 	if (_current_player >= MAX_PLAYERS) return true;
    49 
    49 
    50 	if (IsTileType(tile, MP_STREET) && IsLevelCrossing(tile)) {
    50 	owner = IsLevelCrossingTile(tile) ? GetCrossingRoadOwner(tile) : GetTileOwner(tile);
    51 		owner = GetCrossingRoadOwner(tile);
    51 
    52 	} else {
       
    53 		owner = GetTileOwner(tile);
       
    54 	}
       
    55 	// Only do the special processing if the road is owned
    52 	// Only do the special processing if the road is owned
    56 	// by a town
    53 	// by a town
    57 	if (owner != OWNER_TOWN) {
    54 	if (owner != OWNER_TOWN) {
    58 		return owner == OWNER_NONE || CheckOwnership(owner);
    55 		return owner == OWNER_NONE || CheckOwnership(owner);
    59 	}
    56 	}
   110 	if (p1 >> 4) return CMD_ERROR;
   107 	if (p1 >> 4) return CMD_ERROR;
   111 	pieces = p1;
   108 	pieces = p1;
   112 
   109 
   113 	if (!IsTileType(tile, MP_STREET) && !IsTileType(tile, MP_TUNNELBRIDGE)) return CMD_ERROR;
   110 	if (!IsTileType(tile, MP_STREET) && !IsTileType(tile, MP_TUNNELBRIDGE)) return CMD_ERROR;
   114 
   111 
   115 	owner = IsLevelCrossing(tile) ? GetCrossingRoadOwner(tile) : GetTileOwner(tile);
   112 	owner = IsLevelCrossingTile(tile) ? GetCrossingRoadOwner(tile) : GetTileOwner(tile);
   116 
   113 
   117 	if (owner == OWNER_TOWN && _game_mode != GM_EDITOR) {
   114 	if (owner == OWNER_TOWN && _game_mode != GM_EDITOR) {
   118 		if (IsTileType(tile, MP_TUNNELBRIDGE)) { // index of town is not saved for bridge (no space)
   115 		if (IsTileType(tile, MP_TUNNELBRIDGE)) { // index of town is not saved for bridge (no space)
   119 			t = ClosestTownFromTile(tile, _patches.dist_local_authority);
   116 			t = ClosestTownFromTile(tile, _patches.dist_local_authority);
   120 		} else {
   117 		} else {