- bugfix for segfault (using wrong index variables again). This time I understand what to change and what not to change :)

This commit is contained in:
Mark Vejvoda 2010-10-22 17:29:23 +00:00
parent 6ace9ad571
commit b72124a89a
3 changed files with 3 additions and 3 deletions

View File

@ -774,7 +774,7 @@ void Game::ReplaceDisconnectedNetworkPlayersWithAI(bool isNetworkGame, NetworkRo
faction->getControlType() == ctNetworkCpu ||
faction->getControlType() == ctNetworkCpuUltra ||
faction->getControlType() == ctNetworkCpuMega) {
ConnectionSlot *slot = server->getSlot(faction->getIndex());
ConnectionSlot *slot = server->getSlot(faction->getStartLocationIndex());
if(aiInterfaces[i] == NULL && (slot == NULL || slot->isConnected() == false)) {
faction->setControlType(ctCpu);

View File

@ -77,7 +77,7 @@ void Faction::init(
}
texture= Renderer::getInstance().newTexture2D(rsGame);
texture->load("data/core/faction_textures/faction"+intToStr(index)+".tga");
texture->load("data/core/faction_textures/faction"+intToStr(startLocationIndex)+".tga");
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
}

View File

@ -866,7 +866,7 @@ void World::initFactionTypes(GameSettings *gs){
for(int i=0; i < factions.size(); ++i) {
const FactionType *ft= techTree->getType(gs->getFactionTypeName(i));
factions[i].init(
ft, gs->getFactionControl(i), techTree, game, gs->getStartLocationIndex(i), gs->getTeam(i),
ft, gs->getFactionControl(i), techTree, game, i, gs->getTeam(i),
gs->getStartLocationIndex(i), i==thisFactionIndex, gs->getDefaultResources());
stats.setTeam(i, gs->getTeam(i));