QTfrontend/game.cpp
changeset 2584 cc049fbb65ef
parent 2468 0b62498c201a
child 2747 7889a3a9724f
--- a/QTfrontend/game.cpp	Sun Oct 25 12:19:47 2009 +0000
+++ b/QTfrontend/game.cpp	Sun Oct 25 12:40:47 2009 +0000
@@ -136,13 +136,6 @@
 	QByteArray traincfg;
 	HWProto::addStringToBuffer(traincfg, "TL");
 
-	HWTeam team1;
-	team1.difficulty = 0;
-	team1.teamColor = *color1;
-	team1.numHedgehogs = 1;
-	HWProto::addStringListToBuffer(traincfg,
-			team1.TeamGameConfig(100));
-
 	QFile file(datadir->absolutePath() + "/Trainings/" + training + ".txt");
 	if(!file.open(QFile::ReadOnly))
 	{
@@ -153,7 +146,14 @@
 	QTextStream stream(&file);
 	while(!stream.atEnd())
 	{
-		HWProto::addStringToBuffer(traincfg, "e" + stream.readLine());
+		QString line = stream.readLine();
+		if(!line.isEmpty() && !line.startsWith("#"))
+			if(line != "<binds>")
+				HWProto::addStringToBuffer(traincfg, "e" + line);
+			else
+				for(int i = 0; i < BINDS_NUMBER; i++)
+					if(!cbinds[i].strbind.isEmpty())
+						HWProto::addStringToBuffer(traincfg, "ebind " + cbinds[i].strbind + " " + cbinds[i].action);
 	}
 
 	RawSendIPC(traincfg);