From b040a479bcb990804abd0495a6cf51c4c29dfc36 Mon Sep 17 00:00:00 2001 From: mathusummut Date: Wed, 26 Sep 2018 22:25:44 +0200 Subject: [PATCH] Fixed potential command-ordering issue --- source/glest_game/game/commander.cpp | 6 +++--- source/glest_game/game/commander.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/source/glest_game/game/commander.cpp b/source/glest_game/game/commander.cpp index f7d306f7b..2eecbff71 100644 --- a/source/glest_game/game/commander.cpp +++ b/source/glest_game/game/commander.cpp @@ -486,7 +486,7 @@ namespace unitId, commandType->getId(), currPos, -1, targetId, -1, tryQueue, cst_None, -1, unitCommandGroupId); - resultCur = pushNetworkCommand(&networkCommand); + resultCur = pushNetworkCommand(&networkCommand, isMove); } results.push_back(resultCur); } else if (!ignoreBuildings && unit->isMeetingPointSettable()) { @@ -645,7 +645,7 @@ namespace std::pair < CommandResult, string > Commander::pushNetworkCommand(const NetworkCommand * - networkCommand) const { + networkCommand, bool insertAtStart) const { GameNetworkInterface * gameNetworkInterface = NetworkManager::getInstance().getGameNetworkInterface(); @@ -689,7 +689,7 @@ namespace } //add the command to the interface - gameNetworkInterface->requestCommand(networkCommand, true); + gameNetworkInterface->requestCommand(networkCommand, insertAtStart); //calculate the result of the command if (unit != NULL diff --git a/source/glest_game/game/commander.h b/source/glest_game/game/commander.h index 6ffcc7e15..86f1701a4 100644 --- a/source/glest_game/game/commander.h +++ b/source/glest_game/game/commander.h @@ -177,7 +177,7 @@ namespace std::pair < CommandResult, string > - pushNetworkCommand(const NetworkCommand * networkCommand) const; + pushNetworkCommand(const NetworkCommand * networkCommand, bool insertAtStart = false) const; std::pair < CommandResult, string >