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
This commit is contained in:
@@ -440,7 +440,9 @@ forAllConnectedPlayers(ForAllCallback callback, void *arg) {
|
|||||||
bool
|
bool
|
||||||
setupInputDelay(size_t localInputDelay) {
|
setupInputDelay(size_t localInputDelay) {
|
||||||
COUNT player;
|
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++)
|
for (player = 0; player < NUM_PLAYERS; player++)
|
||||||
{
|
{
|
||||||
@@ -451,10 +453,14 @@ setupInputDelay(size_t localInputDelay) {
|
|||||||
if (!NetConnection_isConnected(conn))
|
if (!NetConnection_isConnected(conn))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
haveNetworkPlayer = true;
|
||||||
if (NetConnection_getInputDelay(conn) > inputDelay)
|
if (NetConnection_getInputDelay(conn) > inputDelay)
|
||||||
inputDelay = NetConnection_getInputDelay(conn);
|
inputDelay = NetConnection_getInputDelay(conn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (haveNetworkPlayer && inputDelay < localInputDelay)
|
||||||
|
inputDelay = localInputDelay;
|
||||||
|
|
||||||
setBattleInputDelay(inputDelay);
|
setBattleInputDelay(inputDelay);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user