mirror of
https://github.com/glest/glest-source.git
synced 2025-09-01 12:02:36 +02:00
- bugfix for in game joining, loading saved game needs to change this to properly indicate which faction is the joining players
This commit is contained in:
@@ -5798,10 +5798,9 @@ void Game::loadGame(string name,Program *programPtr,bool isMasterserverMode,cons
|
|||||||
newGameSettings = *joinGameSettings;
|
newGameSettings = *joinGameSettings;
|
||||||
|
|
||||||
XmlNode *worldNode = gameNode->getChild("World");
|
XmlNode *worldNode = gameNode->getChild("World");
|
||||||
|
|
||||||
//gui.loadGame(loadGameNode,&world);
|
|
||||||
XmlNode *guiNode = gameNode->getChild("Gui");
|
XmlNode *guiNode = gameNode->getChild("Gui");
|
||||||
XmlNode *selectionNode = guiNode->getChild("Selection");
|
XmlNode *selectionNode = guiNode->getChild("Selection");
|
||||||
|
XmlNode *statsNode = worldNode->getChild("Stats");
|
||||||
|
|
||||||
NetworkManager &networkManager= NetworkManager::getInstance();
|
NetworkManager &networkManager= NetworkManager::getInstance();
|
||||||
NetworkRole role = networkManager.getNetworkRole();
|
NetworkRole role = networkManager.getNetworkRole();
|
||||||
@@ -5819,20 +5818,20 @@ void Game::loadGame(string name,Program *programPtr,bool isMasterserverMode,cons
|
|||||||
newGameSettings.setFactionControl(i, ctNetwork);
|
newGameSettings.setFactionControl(i, ctNetwork);
|
||||||
|
|
||||||
worldNode->getAttribute("thisFactionIndex")->setValue(intToStr(i));
|
worldNode->getAttribute("thisFactionIndex")->setValue(intToStr(i));
|
||||||
worldNode->getAttribute("thisTeamIndex")->setValue(intToStr(newGameSettings.getTeam(i)));
|
//worldNode->getAttribute("thisTeamIndex")->setValue(intToStr(newGameSettings.getTeam(i)));
|
||||||
|
|
||||||
XmlNode *factionNode = worldNode->getChild("Faction",i);
|
XmlNode *factionNode = worldNode->getChild("Faction",i);
|
||||||
factionNode->getAttribute("thisFaction")->setValue(intToStr(i));
|
factionNode->getAttribute("thisFaction")->setValue(intToStr(i));
|
||||||
factionNode->getAttribute("control")->setValue(intToStr(ctNetwork));
|
factionNode->getAttribute("control")->setValue(intToStr(ctNetwork));
|
||||||
|
|
||||||
selectionNode->getAttribute("factionIndex")->setValue(intToStr(i));
|
selectionNode->getAttribute("factionIndex")->setValue(intToStr(i));
|
||||||
selectionNode->getAttribute("teamIndex")->setValue(intToStr(newGameSettings.getTeam(i)));
|
//selectionNode->getAttribute("teamIndex")->setValue(intToStr(newGameSettings.getTeam(i)));
|
||||||
|
|
||||||
|
statsNode->getAttribute("thisFactionIndex")->setValue(intToStr(i));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
//XmlNode *factionNode = worldNode->getChild("Faction",i);
|
XmlNode *factionNode = worldNode->getChild("Faction",i);
|
||||||
//if(factionNode->hasAttribute("control") == true) {
|
factionNode->getAttribute("thisFaction")->setValue(intToStr(0));
|
||||||
// factionNode->getAttribute("control")->setValue(intToStr(ctNetwork));
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user