From 24444d4af3d3e9dc7c2989e5d79ae0e9cee515b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sun, 3 May 2015 22:17:27 +0200 Subject: [PATCH] fix a crash in AmbientSound --- OpenRA.Mods.Common/Traits/Sound/AmbientSound.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OpenRA.Mods.Common/Traits/Sound/AmbientSound.cs b/OpenRA.Mods.Common/Traits/Sound/AmbientSound.cs index 967f8b9b2d..c8d971d457 100644 --- a/OpenRA.Mods.Common/Traits/Sound/AmbientSound.cs +++ b/OpenRA.Mods.Common/Traits/Sound/AmbientSound.cs @@ -24,10 +24,10 @@ namespace OpenRA.Mods.Common.Traits { public AmbientSound(Actor self, AmbientSoundInfo info) { - if (self == self.World.WorldActor) - Sound.PlayLooped(info.SoundFile); - else + if (self.HasTrait()) Sound.PlayLooped(info.SoundFile, self.CenterPosition); + else + Sound.PlayLooped(info.SoundFile); } } }