From 9d33198ba3059370a725e990453ce6f8526d836b Mon Sep 17 00:00:00 2001 From: Meep-Eep Date: Tue, 19 Dec 2006 00:23:42 +0000 Subject: [PATCH] Fixed a bug where an input delay was used for non-network games. git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2626 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/src/sc2code/netplay/netmelee.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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; }