Ticket #591: BugFix#591.patch
File BugFix#591.patch, 1.4 KB (added by , 13 years ago) |
---|
-
CCmpSoundManager.cpp
23 23 #include "ps/CLogger.h" 24 24 #include "simulation2/MessageTypes.h" 25 25 #include "simulation2/components/ICmpPosition.h" 26 #include "simulation2/components/ICmpRangeManager.h" 26 27 #include "sound/SoundGroup.h" 27 28 28 29 class CCmpSoundManager : public ICmpSoundManager … … 110 111 111 112 // Find the source's position, if possible 112 113 // (TODO: we should do something more sensible if there's no position available) 113 CVector3D sourcePos(0, 0, 0); 114 if (source != INVALID_ENTITY) 114 CmpPtr<ICmpRangeManager> cmpRangeManager(GetSimContext(), SYSTEM_ENTITY); 115 ICmpRangeManager::ELosVisibility m_Visibility = cmpRangeManager->GetLosVisibility(source, GetSimContext().GetCurrentDisplayedPlayer()); 116 117 if (m_Visibility == ICmpRangeManager::VIS_VISIBLE) 115 118 { 116 CmpPtr<ICmpPosition> cmpPosition(GetSimContext(), source); 117 if (!cmpPosition.null() && cmpPosition->IsInWorld()) 118 sourcePos = CVector3D(cmpPosition->GetPosition()); 119 CVector3D sourcePos(0, 0, 0); 120 if (source != INVALID_ENTITY) 121 { 122 CmpPtr<ICmpPosition> cmpPosition(GetSimContext(), source); 123 if (!cmpPosition.null() && cmpPosition->IsInWorld()) 124 sourcePos = CVector3D(cmpPosition->GetPosition()); 125 } 126 127 group->PlayNext(sourcePos); 119 128 } 120 121 group->PlayNext(sourcePos);122 129 } 123 130 }; 124 131