Don't crash when putting the trait on the World actor.
This commit is contained in:
committed by
reaperrr
parent
3ab4a584ab
commit
672bd2d9fe
@@ -52,13 +52,16 @@ namespace OpenRA.Mods.Common.Traits.Sound
|
|||||||
|
|
||||||
currentSounds.RemoveWhere(s => s == null || s.Complete);
|
currentSounds.RemoveWhere(s => s == null || s.Complete);
|
||||||
|
|
||||||
var pos = self.CenterPosition;
|
if (self.OccupiesSpace != null)
|
||||||
if (pos != cachedPosition)
|
|
||||||
{
|
{
|
||||||
foreach (var s in currentSounds)
|
var pos = self.CenterPosition;
|
||||||
s.SetPosition(pos);
|
if (pos != cachedPosition)
|
||||||
|
{
|
||||||
|
foreach (var s in currentSounds)
|
||||||
|
s.SetPosition(pos);
|
||||||
|
|
||||||
cachedPosition = pos;
|
cachedPosition = pos;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (delay < 0)
|
if (delay < 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user