QTfrontend/game.cpp
changeset 2786 85f6425a4d74
parent 2747 7889a3a9724f
child 2948 3f21a9dc93d0
--- a/QTfrontend/game.cpp	Tue Feb 09 21:51:52 2010 +0000
+++ b/QTfrontend/game.cpp	Wed Feb 10 00:55:40 2010 +0000
@@ -136,25 +136,7 @@
 	QByteArray traincfg;
 	HWProto::addStringToBuffer(traincfg, "TL");
 
-	QFile file(datadir->absolutePath() + "/Trainings/" + training + ".txt");
-	if(!file.open(QFile::ReadOnly))
-	{
-		emit ErrorMessage(tr("Error reading training config file"));
-		return;
-	}
-
-	QTextStream stream(&file);
-	while(!stream.atEnd())
-	{
-		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);
-	}
+	HWProto::addStringToBuffer(traincfg, "escript " + datadir->absolutePath() + "/Missions/" + training + ".hwt");
 
 	RawSendIPC(traincfg);
 }