Fix sndBoring being placed if ending turn during multi-shoot via skip command
For example:
- AI hog shoots once with shotgun
- AI hog ends turn via ParseCommand("skip")
--- a/hedgewars/uGearsHedgehog.pas Wed May 15 19:43:53 2019 +0200
+++ b/hedgewars/uGearsHedgehog.pas Wed May 15 20:40:37 2019 +0200
@@ -1314,7 +1314,7 @@
if TagTurnTimeLeft = 0 then
TagTurnTimeLeft:= TurnTimeLeft;
TurnTimeLeft:= 0;
- if (GameOver = false) and ((GameFlags and gfInfAttack) = 0) and ((HHGear^.State and gstAttacked) = 0) and (HHGear^.Damage = 0) and (LuaNoEndTurnTaunts = false) then
+ if (GameOver = false) and ((GameFlags and gfInfAttack) = 0) and ((HHGear^.State and gstAttacked) = 0) and (HHGear^.Damage = 0) and (LuaNoEndTurnTaunts = false) and (uStats.getIsTurnSkipped() = false) then
begin
AddVoice(sndBoring, Hedgehog^.Team^.voicepack);
if (GameFlags and gfInfAttack = 0) then
--- a/hedgewars/uStats.pas Wed May 15 19:43:53 2019 +0200
+++ b/hedgewars/uStats.pas Wed May 15 20:40:37 2019 +0200
@@ -42,6 +42,7 @@
procedure HedgehogDamaged(Gear: PGear; Attacker: PHedgehog; Damage: Longword; killed: boolean);
procedure TargetHit;
procedure Skipped;
+function getIsTurnSkipped: boolean;
procedure TurnStats;
procedure TurnReaction;
procedure TurnStatsReset;
@@ -191,6 +192,11 @@
isTurnSkipped:= true
end;
+function getIsTurnSkipped: boolean;
+begin
+getIsTurnSkipped:= isTurnSkipped;
+end;
+
procedure TurnStats;
var i, t: LongInt;
c: Longword;