Fixed several sound-related issues that have been bothering me for ages, e.g.
* Sounds not playing when the structure is fully destroyed * Glass windows using wrong sound effects * Only one glassBreak sound was used despite there being 3
This commit is contained in:
@@ -453,10 +453,11 @@ namespace Barotrauma
|
||||
{
|
||||
damage = MathHelper.Clamp(damage+Rand.Range(-10.0f, 10.0f), 0.0f, 100.0f);
|
||||
var sounds = damageSounds.FindAll(s =>
|
||||
damage >= s.damageRange.X &&
|
||||
damage <= s.damageRange.Y &&
|
||||
s.damageRange == null ||
|
||||
(damage >= s.damageRange.X &&
|
||||
damage <= s.damageRange.Y) &&
|
||||
s.damageType == damageType &&
|
||||
(string.IsNullOrEmpty(s.requiredTag) || (tags != null && tags.Contains(s.requiredTag))));
|
||||
(tags == null ? string.IsNullOrEmpty(s.requiredTag) : tags.Contains(s.requiredTag)));
|
||||
|
||||
if (!sounds.Any()) return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user