mirror of
https://github.com/gopher64/gopher64.git
synced 2026-07-11 01:25:20 +02:00
input delay cannot be less than 1 (#1092)
This commit is contained in:
@@ -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
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user