Fixed Ragdoll.ImpactProjSpecific attempting to play limb/wearable hitsounds even if the sound tag is empty, wearable items can cause hit sounds to be played even if the limb has no hit sound configured. Closes #280
This commit is contained in:
@@ -18,14 +18,19 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
Limb limb = (Limb)body.UserData;
|
Limb limb = (Limb)body.UserData;
|
||||||
|
|
||||||
if (impact > 3.0f && limb.HitSound != null && limb.SoundTimer <= 0.0f)
|
if (impact > 3.0f && limb.SoundTimer <= 0.0f)
|
||||||
{
|
{
|
||||||
limb.SoundTimer = Limb.SoundInterval;
|
limb.SoundTimer = Limb.SoundInterval;
|
||||||
SoundPlayer.PlaySound(limb.HitSound, volume, impact * 100.0f, limb.WorldPosition);
|
if (!string.IsNullOrWhiteSpace(limb.HitSound))
|
||||||
foreach(WearableSprite wearable in limb.WearingItems)
|
|
||||||
{
|
{
|
||||||
if (limb.type == wearable.Limb && wearable.Sound != null)
|
SoundPlayer.PlaySound(limb.HitSound, volume, impact * 100.0f, limb.WorldPosition);
|
||||||
|
}
|
||||||
|
foreach (WearableSprite wearable in limb.WearingItems)
|
||||||
|
{
|
||||||
|
if (limb.type == wearable.Limb && !string.IsNullOrWhiteSpace(wearable.Sound))
|
||||||
|
{
|
||||||
SoundPlayer.PlaySound(wearable.Sound, volume, impact * 100.0f, limb.WorldPosition);
|
SoundPlayer.PlaySound(wearable.Sound, volume, impact * 100.0f, limb.WorldPosition);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user