rail_cmd.c
changeset 3242 1cefa03f0d5e
parent 3238 a100405fe221
child 3253 015524c19f16
equal deleted inserted replaced
3241:ffde1325bab8 3242:1cefa03f0d5e
   315 					!EnsureNoVehicle(tile)) {
   315 					!EnsureNoVehicle(tile)) {
   316 				return CMD_ERROR;
   316 				return CMD_ERROR;
   317 			}
   317 			}
   318 			if (m5 & RAIL_TYPE_SPECIAL ||
   318 			if (m5 & RAIL_TYPE_SPECIAL ||
   319 					!IsTileOwner(tile, _current_player) ||
   319 					!IsTileOwner(tile, _current_player) ||
   320 					GB(_m[tile].m3, 0, 4) != p1) {
   320 					GetRailType(tile) != p1) {
   321 				// Get detailed error message
   321 				// Get detailed error message
   322 				return DoCommandByTile(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
   322 				return DoCommandByTile(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
   323 			}
   323 			}
   324 
   324 
   325 			ret = CheckRailSlope(tileh, trackbit, GetTrackBits(tile), tile);
   325 			ret = CheckRailSlope(tileh, trackbit, GetTrackBits(tile), tile);
   942 	// tile is already of requested type?
   942 	// tile is already of requested type?
   943 	if (GetRailType(tile) == totype) return CMD_ERROR;
   943 	if (GetRailType(tile) == totype) return CMD_ERROR;
   944 
   944 
   945 	// change type.
   945 	// change type.
   946 	if (exec) {
   946 	if (exec) {
   947 		SB(_m[tile].m3, 0, 4, totype);
   947 		SetRailType(tile, totype);
   948 		MarkTileDirtyByTile(tile);
   948 		MarkTileDirtyByTile(tile);
   949 	}
   949 	}
   950 
   950 
   951 	return _price.build_rail / 2;
   951 	return _price.build_rail / 2;
   952 }
   952 }