QTfrontend/gamecfgwidget.cpp
changeset 2380 603965eca22b
parent 2377 f3fab2b09e0c
child 2703 fbde0d971ba6
--- a/QTfrontend/gamecfgwidget.cpp	Thu Sep 10 18:50:53 2009 +0000
+++ b/QTfrontend/gamecfgwidget.cpp	Sun Sep 13 17:51:25 2009 +0000
@@ -144,11 +144,12 @@
 
 void GameCFGWidget::setNetAmmo(const QString& name, const QString& ammo)
 {
-	if (ammo.size() != cDefaultAmmoStore->size())
+	bool illegal = ammo.size() != cDefaultAmmoStore->size();
+	if (illegal)
 		QMessageBox::critical(this, tr("Error"), tr("Illegal ammo scheme"));
 
 	int pos = WeaponsName->findText(name);
-	if (pos == -1) {
+	if ((pos == -1) || illegal) { // prevent from overriding schemes with bad ones
 		WeaponsName->addItem(name, ammo);
 		WeaponsName->setCurrentIndex(WeaponsName->count() - 1);
 	} else {