diff --git a/src/device/controller.rs b/src/device/controller.rs index c2d6a3b..3b279ff 100644 --- a/src/device/controller.rs +++ b/src/device/controller.rs @@ -56,17 +56,14 @@ pub fn process(device: &mut device::Device, channel: usize) { } JCMD_CONTROLLER_READ => { let offset = device.pif.channels[channel].rx_buf.unwrap(); - let input = if device.netplay.is_none() { - ui::input::get(&device.ui, channel) - } else { - if let Some(netplay) = &mut device.netplay - && netplay.player_number as usize == channel - { + let input = if let Some(netplay) = &mut device.netplay { + if netplay.player_number as usize == channel { let local_input = ui::input::get(&device.ui, 0); netplay::send_input(netplay, local_input); } - netplay::get_input(device, channel) + } else { + ui::input::get(&device.ui, channel) }; device.pif.ram[offset..offset + 4].copy_from_slice(&input.data.to_ne_bytes());