fix a crash in AmbientSound

This commit is contained in:
Matthias Mailänder
2015-05-03 22:17:27 +02:00
parent a753a114a0
commit 24444d4af3

View File

@@ -24,10 +24,10 @@ namespace OpenRA.Mods.Common.Traits
{ {
public AmbientSound(Actor self, AmbientSoundInfo info) public AmbientSound(Actor self, AmbientSoundInfo info)
{ {
if (self == self.World.WorldActor) if (self.HasTrait<IOccupySpace>())
Sound.PlayLooped(info.SoundFile);
else
Sound.PlayLooped(info.SoundFile, self.CenterPosition); Sound.PlayLooped(info.SoundFile, self.CenterPosition);
else
Sound.PlayLooped(info.SoundFile);
} }
} }
} }