FireWarheads: play weapon report sound in Tick() not in FrameEndTask

This commit is contained in:
michaeldgg2
2023-10-07 16:14:44 +02:00
committed by Gustas
parent 6367729f98
commit 9ae26f2645

View File

@@ -72,11 +72,8 @@ namespace OpenRA.Mods.Common.Traits
foreach (var wep in Info.WeaponInfos)
{
wep.Impact(Target.FromPos(self.CenterPosition), self);
self.World.AddFrameEndTask(world =>
{
if (wep.Report != null && wep.Report.Length > 0)
Game.Sound.Play(SoundType.World, wep.Report, world, self.CenterPosition);
});
if (wep.Report != null && wep.Report.Length > 0)
Game.Sound.Play(SoundType.World, wep.Report, self.World, self.CenterPosition);
}
}
}