Ensure that Clan ammo always takes precedence over Per Hog Ammo in the flags. It'd be best for the user sake if these buttons acted more like radio buttons.
authornemo
Sun, 10 Jun 2012 14:36:40 -0400
changeset 7218 9ecd5bc9810b
parent 7216 53f5e48b8375
child 7220 dfe678f129e4
child 7221 8d04e85ca204
Ensure that Clan ammo always takes precedence over Per Hog Ammo in the flags. It'd be best for the user sake if these buttons acted more like radio buttons.
QTfrontend/game.cpp
hedgewars/uCommandHandlers.pas
--- a/QTfrontend/game.cpp	Sat Jun 09 17:15:45 2012 -0400
+++ b/QTfrontend/game.cpp	Sun Jun 10 14:36:40 2012 -0400
@@ -98,7 +98,7 @@
             HWProto::addStringToBuffer(buf, QString("eammprob %1").arg(ammostr.mid(cAmmoNumber, cAmmoNumber)));
             HWProto::addStringToBuffer(buf, QString("eammdelay %1").arg(ammostr.mid(2 * cAmmoNumber, cAmmoNumber)));
             HWProto::addStringToBuffer(buf, QString("eammreinf %1").arg(ammostr.mid(3 * cAmmoNumber, cAmmoNumber)));
-            if(!gamecfg->schemeData(21).toBool()) HWProto::addStringToBuffer(buf, QString("eammstore"));
+            if(gamecfg->schemeData(15).toBool() || !gamecfg->schemeData(21).toBool()) HWProto::addStringToBuffer(buf, QString("eammstore"));
             HWProto::addStringListToBuffer(buf,
                                            team.teamGameConfig(gamecfg->getInitHealth()));
             ;
--- a/hedgewars/uCommandHandlers.pas	Sat Jun 09 17:15:45 2012 -0400
+++ b/hedgewars/uCommandHandlers.pas	Sun Jun 10 14:36:40 2012 -0400
@@ -763,7 +763,8 @@
 
 procedure chGameFlags(var s: shortstring);
 begin
-GameFlags:= StrToInt(s)
+GameFlags:= StrToInt(s);
+if GameFlags and gfSharedAmmo <> 0 then GameFlags:= GameFlags and not gfPerHogAmmo
 end;
 
 procedure chHedgehogTurnTime(var s: shortstring);