hedgewars/uStats.pas
changeset 1054 80225c6af656
parent 874 964c0d5b3604
child 1058 c53c5c4e7b48
--- a/hedgewars/uStats.pas	Sun Jul 06 14:09:41 2008 +0000
+++ b/hedgewars/uStats.pas	Sun Jul 06 17:45:16 2008 +0000
@@ -38,6 +38,8 @@
 procedure TurnReaction;
 procedure SendStats;
 
+var FinishedTurnsTotal: LongInt = -1;
+
 implementation
 uses uTeams, uSound, uMisc;
 var DamageGiven : Longword = 0;
@@ -48,12 +50,13 @@
     KillsTotal  : LongWord = 0;
     AmmoUsedCount : Longword = 0;
     AmmoDamagingUsed : boolean = false;
-    FinishedTurnsTotal: LongInt = -1;
     SkippedTurns: LongWord = 0;
     isTurnSkipped: boolean = false;
 
 procedure HedgehogDamaged(Gear: PGear);
 begin
+if bBetweenTurns then exit;
+
 if Gear <> CurrentHedgehog^.Gear then
 	inc(CurrentHedgehog^.stats.StepDamageGiven, Gear^.Damage);
 
@@ -81,6 +84,8 @@
 procedure TurnReaction;
 var i, t: LongInt;
 begin
+TryDo(not bBetweenTurns, 'Engine bug: TurnReaction between turns', true);
+
 inc(FinishedTurnsTotal);
 if FinishedTurnsTotal = 0 then exit;
 
@@ -112,7 +117,7 @@
 
 else if AmmoDamagingUsed then
 	PlaySound(sndMissed, false)
-else if AmmoUsedCount > 0 then
+else if (AmmoUsedCount > 0) and not isTurnSkipped then
 	// nothing ?
 else if isTurnSkipped then
 	PlaySound(sndBoring, false)