diff --git a/sc2/src/sc2code/netplay/netmelee.c b/sc2/src/sc2code/netplay/netmelee.c index 2b1a2e723..d38d28044 100644 --- a/sc2/src/sc2code/netplay/netmelee.c +++ b/sc2/src/sc2code/netplay/netmelee.c @@ -440,7 +440,9 @@ forAllConnectedPlayers(ForAllCallback callback, void *arg) { bool setupInputDelay(size_t localInputDelay) { COUNT player; - size_t inputDelay = localInputDelay; + bool haveNetworkPlayer = false; + // We have at least one network controlled player. + size_t inputDelay = 0; for (player = 0; player < NUM_PLAYERS; player++) { @@ -451,10 +453,14 @@ setupInputDelay(size_t localInputDelay) { if (!NetConnection_isConnected(conn)) continue; + haveNetworkPlayer = true; if (NetConnection_getInputDelay(conn) > inputDelay) inputDelay = NetConnection_getInputDelay(conn); } + if (haveNetworkPlayer && inputDelay < localInputDelay) + inputDelay = localInputDelay; + setBattleInputDelay(inputDelay); return true; }