QTfrontend/newnetclient.cpp
changeset 703 424297e3165a
parent 697 44f167938201
child 747 c7f67e90c3ee
--- a/QTfrontend/newnetclient.cpp	Sat Jan 12 17:17:09 2008 +0000
+++ b/QTfrontend/newnetclient.cpp	Sat Jan 12 22:41:03 2008 +0000
@@ -284,7 +284,8 @@
 	  return;
   	}
 	if (lst[1] == "AMMO") {
-	  emit ammoChanged(lst[2]);
+	  if(lst.size() < 4) return;
+	  emit ammoChanged(lst[3], lst[2]);
 	  return;
 	}
 	QStringList hhTmpList=lst[1].split('+');
@@ -340,7 +341,7 @@
   onTurnTimeChanged(m_pGameCFGWidget->getTurnTime());
   onFortsModeChanged(m_pGameCFGWidget->getGameFlags() & 0x1);
   // always initialize with default ammo (also avoiding complicated cross-class dependencies)
-  onWeaponsNameChanged(cDefaultAmmoStore->mid(10)); 
+  onWeaponsNameChanged("Default", cDefaultAmmoStore->mid(10)); 
 }
 
 void HWNewNet::RunGame()
@@ -392,9 +393,9 @@
   RawSendNet(QString("CONFIG_PARAM%1FORTSMODE%1%2").arg(delimeter).arg(value));
 }
 
-void HWNewNet::onWeaponsNameChanged(const QString& ammo)
+void HWNewNet::onWeaponsNameChanged(const QString& name, const QString& ammo)
 {
-  RawSendNet(QString("CONFIG_PARAM%1AMMO%1%2").arg(delimeter).arg(ammo));
+  RawSendNet(QString("CONFIG_PARAM%1AMMO%1%2%1%3").arg(delimeter).arg(ammo).arg(name));
 }
 
 void HWNewNet::chatLineToNet(const QString& str)