Now trainings can have custom ammostore
authorunc0rr
Sat, 22 Sep 2007 10:45:18 +0000
changeset 607 26a91a9f5514
parent 606 9d800fdfd3bd
child 608 05c140c8ec27
Now trainings can have custom ammostore
QTfrontend/game.cpp
QTfrontend/hwconsts.cpp.in
QTfrontend/hwconsts.h
QTfrontend/team.cpp
share/hedgewars/Data/Trainings/001_Shotgun.txt
--- a/QTfrontend/game.cpp	Sat Sep 22 10:06:27 2007 +0000
+++ b/QTfrontend/game.cpp	Sat Sep 22 10:45:18 2007 +0000
@@ -85,6 +85,7 @@
 		{
 			HWProto::addStringListToBuffer(buf,
 				(*it).TeamGameConfig(gamecfg->getInitHealth()));
+			HWProto::addStringToBuffer(buf, *cDefaultAmmoStore);
 		}
 	}
 	RawSendIPC(buf);
@@ -111,19 +112,18 @@
 	team2.difficulty = 4;
 	team2.teamColor = QColor(16776960);
 	team2.numHedgehogs = 4;
-	RawSendIPC(HWProto::addStringListToBuffer(teamscfg,
-			team2.TeamGameConfig(gamecfg->getInitHealth())));
+	HWProto::addStringListToBuffer(teamscfg,
+			team2.TeamGameConfig(gamecfg->getInitHealth()));
+
+	HWProto::addStringToBuffer(teamscfg, *cDefaultAmmoStore);
+	HWProto::addStringToBuffer(teamscfg, *cDefaultAmmoStore);
+	RawSendIPC(teamscfg);
 }
 
 void HWGame::SendTrainingConfig()
 {
 	QByteArray teamscfg;
 	HWProto::addStringToBuffer(teamscfg, "TL");
-	HWProto::addStringToBuffer(teamscfg, "eseed none");
-	HWProto::addStringToBuffer(teamscfg, QString("e$gmflags %1").arg(0x10000000));
-	HWProto::addStringToBuffer(teamscfg, "e$turntime 60000");
-	HWProto::addStringToBuffer(teamscfg, "emap mushrooms");
-	HWProto::addStringToBuffer(teamscfg, "etheme avematan");
 
 	HWTeam team1(0);
 	team1.difficulty = 0;
--- a/QTfrontend/hwconsts.cpp.in	Sat Sep 22 10:06:27 2007 +0000
+++ b/QTfrontend/hwconsts.cpp.in	Sat Sep 22 10:45:18 2007 +0000
@@ -26,3 +26,5 @@
 QDir * datadir = new QDir();
 
 QStringList * Themes;
+
+QString * cDefaultAmmoStore = "eammstore 93919294221912103323";
\ No newline at end of file
--- a/QTfrontend/hwconsts.h	Sat Sep 22 10:06:27 2007 +0000
+++ b/QTfrontend/hwconsts.h	Sat Sep 22 10:45:18 2007 +0000
@@ -28,3 +28,5 @@
 extern QDir * datadir;
 
 extern QStringList * Themes;
+
+extern QString * cDefaultAmmoStore;
--- a/QTfrontend/team.cpp	Sat Sep 22 10:06:27 2007 +0000
+++ b/QTfrontend/team.cpp	Sat Sep 22 10:45:18 2007 +0000
@@ -213,7 +213,6 @@
 {
 	QStringList sl;
 	sl.push_back(QString("eaddteam %1 %2").arg(teamColor.rgb() & 0xffffff).arg(TeamName));
-	sl.push_back("eammstore 93919294221912103323");
 
 	if (m_netID)
 		sl.push_back("erdriven");
--- a/share/hedgewars/Data/Trainings/001_Shotgun.txt	Sat Sep 22 10:06:27 2007 +0000
+++ b/share/hedgewars/Data/Trainings/001_Shotgun.txt	Sat Sep 22 10:45:18 2007 +0000
@@ -1,3 +1,9 @@
+eseed none
+e$gmflags 268435456
+e$turntime 60000
+emap mushrooms
+etheme avematan
+eammstore 00009000000000000000
 ehhcoords 1500 310
 eaddtrig s2147483649 1 1 33 1100 -100 1
 eaddtrig s1 1 1 33 1200 -100 2