input delay cannot be less than 1 (#1092)

This commit is contained in:
Logan McNaughton
2026-06-16 16:02:02 +02:00
committed by GitHub
parent 2b0d8e5423
commit b123ed9fa3
2 changed files with 5 additions and 1 deletions
+4
View File
@@ -203,6 +203,10 @@ pub fn receive_save(netplay: &mut Netplay, save_type: &str, save_data: &mut Vec<
}
pub fn send_input_delay(netplay: &mut Netplay, input_delay: usize) {
if input_delay < 1 {
return;
}
let message = NetplayMessage {
name: "input_delay".to_string(),
data: (input_delay as u64).to_be_bytes().to_vec(),
+1 -1
View File
@@ -247,7 +247,7 @@ pub fn check_callback(device: &mut device::Device) -> (bool, bool) {
if let Some(netplay) = &mut device.netplay
&& netplay.player_number == 0
{
if callback.decrease_input_delay && netplay.input_delay > 0 {
if callback.decrease_input_delay {
netplay::send_input_delay(netplay, netplay.input_delay - 1);
} else if callback.increase_input_delay {
netplay::send_input_delay(netplay, netplay.input_delay + 1);