QTfrontend/hwform.cpp
changeset 140 50ccde437ea1
parent 137 bcab861a3262
child 144 e6084b0c9316
--- a/QTfrontend/hwform.cpp	Sun Sep 03 18:01:34 2006 +0000
+++ b/QTfrontend/hwform.cpp	Sat Sep 09 16:59:10 2006 +0000
@@ -67,9 +67,8 @@
 
 	for (QStringList::Iterator it = teamslist.begin(); it != teamslist.end(); ++it )
 	{
-	  QString tmpTeamStr=(*it).replace(QRegExp("^(.*).cfg$"), "\\1");
-	  ui.pageMultiplayer->teamsSelect->addTeam(tmpTeamStr);
-	  ui.pageOptions->CBTeamName->addItem(tmpTeamStr);
+	  ui.pageMultiplayer->teamsSelect->addTeam(*it);
+	  ui.pageOptions->CBTeamName->addItem(*it);
 	}
 
 	connect(ui.pageMain->BtnSinglePlayer,	SIGNAL(clicked()),	this, SLOT(GoToSinglePlayer()));
@@ -258,7 +257,11 @@
 void HWForm::StartMPGame()
 {
 	game = new HWGame(config, ui.pageMultiplayer->gameCFG);
-	game->AddTeam("DefaultTeam");
-	game->AddTeam("DefaultTeam");
+	QStringList teamslist = config->GetTeamsList();
+	for (QStringList::Iterator it = teamslist.begin(); it != teamslist.end(); ++it ) {
+	  if(ui.pageMultiplayer->teamsSelect->isPlaying(*it)) {
+	    game->AddTeam(*it, ui.pageMultiplayer->teamsSelect->numHedgedogs(*it));
+	  }
+	}
 	game->StartLocal();
 }