mirror of
https://github.com/glest/glest-source.git
synced 2025-08-24 08:52:49 +02:00
Player names of Scenarios were displayed in wrong slot.
The player names were set with wrong index and CPU players had wrong names.
This commit is contained in:
@@ -480,6 +480,8 @@ void Scenario::loadGameSettings(const vector<string> &dirList,
|
|||||||
const ScenarioInfo *scenarioInfo, GameSettings *gameSettings,
|
const ScenarioInfo *scenarioInfo, GameSettings *gameSettings,
|
||||||
string scenarioDescription) {
|
string scenarioDescription) {
|
||||||
int factionCount= 0;
|
int factionCount= 0;
|
||||||
|
int AIPlayerCount=0;
|
||||||
|
Lang &lang= Lang::getInstance();
|
||||||
|
|
||||||
if(gameSettings->getGameUUID() == "") {
|
if(gameSettings->getGameUUID() == "") {
|
||||||
gameSettings->setGameUUID(getUUIDAsString());
|
gameSettings->setGameUUID(getUUIDAsString());
|
||||||
@@ -501,15 +503,21 @@ void Scenario::loadGameSettings(const vector<string> &dirList,
|
|||||||
if(ct == ctHuman) {
|
if(ct == ctHuman) {
|
||||||
gameSettings->setThisFactionIndex(factionCount);
|
gameSettings->setThisFactionIndex(factionCount);
|
||||||
|
|
||||||
if(gameSettings->getNetworkPlayerName(i) == "") {
|
if(gameSettings->getNetworkPlayerName(factionCount) == "") {
|
||||||
gameSettings->setNetworkPlayerName(i,Config::getInstance().getString("NetPlayerName",Socket::getHostName().c_str()));
|
gameSettings->setNetworkPlayerName(factionCount,Config::getInstance().getString("NetPlayerName",Socket::getHostName().c_str()));
|
||||||
}
|
}
|
||||||
gameSettings->setNetworkPlayerUUID(i,Config::getInstance().getString("PlayerId",""));
|
gameSettings->setNetworkPlayerUUID(factionCount,Config::getInstance().getString("PlayerId",""));
|
||||||
gameSettings->setNetworkPlayerPlatform(i,getPlatformNameString());
|
gameSettings->setNetworkPlayerPlatform(factionCount,getPlatformNameString());
|
||||||
}
|
}
|
||||||
else {
|
else if(ct == ctNetwork || ct == ctNetworkUnassigned){
|
||||||
if(gameSettings->getNetworkPlayerName(i) == "") {
|
if(gameSettings->getNetworkPlayerName(factionCount) == "") {
|
||||||
gameSettings->setNetworkPlayerName(i,controllerTypeToStr(ct));
|
gameSettings->setNetworkPlayerName(factionCount,controllerTypeToStr(ct));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {//this is a CPU player
|
||||||
|
AIPlayerCount++;
|
||||||
|
if(gameSettings->getNetworkPlayerName(factionCount) == "") {
|
||||||
|
gameSettings->setNetworkPlayerName(factionCount,lang.getString("AI") + intToStr(AIPlayerCount));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
gameSettings->setFactionControl(factionCount, ct);
|
gameSettings->setFactionControl(factionCount, ct);
|
||||||
|
Reference in New Issue
Block a user