Restore shared clan ammo (still needs flag), add ammo info message if the person who picked up the ammo was a member of your clan
--- a/hedgewars/CCHandlers.inc Tue Feb 23 15:41:37 2010 +0000
+++ b/hedgewars/CCHandlers.inc Tue Feb 23 19:25:38 2010 +0000
@@ -153,12 +153,9 @@
val(s, Gear^.Health);
TryDo(Gear^.Health > 0, 'Invalid hedgehog health', true);
PHedgehog(Gear^.Hedgehog)^.Team:= CurrentTeam;
- //CurrentHedgehog^.AmmoStore:= ClansCount - 1; // FIXME HACK to get ammostores work
-// ClansCount above causes shared ammo across clans, have demo game that functions as of this revision.
-// need to find out why before restoring.
-// Also needs a frontend game flag.
-// Is *not* related to randomising clan order.
- CurrentHedgehog^.AmmoStore:= TeamsCount - 1; // FIXME HACK to get ammostores work
+// Needs shared clan ammo game flag
+ CurrentHedgehog^.AmmoStore:= Clan^.ClanIndex; // FIXME HACK to get ammostores work
+ //CurrentHedgehog^.AmmoStore:= TeamsCount - 1; // FIXME HACK to get ammostores work
CurrentHedgehog^.Gear:= Gear;
CurrentHedgehog^.Name:= id;
CurrHedgehog:= HedgehogsNumber;
--- a/hedgewars/HHHandlers.inc Tue Feb 23 15:41:37 2010 +0000
+++ b/hedgewars/HHHandlers.inc Tue Feb 23 19:25:38 2010 +0000
@@ -312,7 +312,10 @@
posCaseAmmo: begin
a:= TAmmoType(Gear^.State);
AddAmmo(PHedgehog(HH^.Hedgehog)^, a);
- if (not (PHedgehog(HH^.Hedgehog)^.Team^.ExtDriven
+// Possibly needs to check shared clan ammo game flag once added.
+// On the other hand, no obvious reason that clan members shouldn't know what ammo another clan member picked up
+ if (not (PHedgehog(HH^.Hedgehog)^.Team^.ExtDriven
+ or (PHedgehog(HH^.Hedgehog)^.Team^.Clan^.ClanIndex = LocalClan-1)
or (PHedgehog(HH^.Hedgehog)^.BotLevel > 0)))
or (GameType = gmtDemo) then
begin