mute avatar collision sounds if parcel doesnt allow

avinationmerge
UbitUmarov 2014-07-30 15:36:49 +01:00
parent 5fe1f87837
commit 2a2a772408
1 changed files with 19 additions and 1 deletions

View File

@ -482,6 +482,22 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
public bool ParcelAllowSounds
{
get
{
ILandObject land = m_scene.LandChannel.GetLandObject(AbsolutePosition.X, AbsolutePosition.Y);
if (land == null)
return true;
if (land.LandData.AnyAVSounds)
return true;
if (!land.LandData.GroupAVSounds)
return false;
return land.LandData.GroupID == ControllingClient.ActiveGroupId;
}
}
public byte State { get; set; } public byte State { get; set; }
private AgentManager.ControlFlags m_AgentControlFlags; private AgentManager.ControlFlags m_AgentControlFlags;
@ -5048,6 +5064,8 @@ namespace OpenSim.Region.Framework.Scenes
else else
{ {
bool candoparcelSound = ParcelAllowSounds;
foreach (uint id in coldata.Keys) foreach (uint id in coldata.Keys)
{ {
thisHitColliders.Add(id); thisHitColliders.Add(id);
@ -5055,7 +5073,7 @@ namespace OpenSim.Region.Framework.Scenes
{ {
startedColliders.Add(id); startedColliders.Add(id);
curcontact = coldata[id]; curcontact = coldata[id];
if (Math.Abs(curcontact.RelativeSpeed) > 0.2) if (candoparcelSound && Math.Abs(curcontact.RelativeSpeed) > 0.2)
{ {
soundinfo = new CollisionForSoundInfo(); soundinfo = new CollisionForSoundInfo();
soundinfo.colliderID = id; soundinfo.colliderID = id;