v1.6.17.0 (Unto the Breach update)

This commit is contained in:
Regalis11
2024-10-22 17:29:04 +03:00
parent e74b3cdb17
commit 6e6c17e100
417 changed files with 17166 additions and 5870 deletions
@@ -78,14 +78,22 @@ namespace Barotrauma
{
bool entityAngleAssigned = false;
Limb targetLimb = null;
if (entity is Item item && item.body != null)
if (entity is Item item)
{
angle = item.body.Rotation + ((item.body.Dir > 0.0f) ? 0.0f : MathHelper.Pi);
particleRotation = -item.body.Rotation;
if (emitter.Prefab.Properties.CopyEntityDir && item.body.Dir < 0.0f)
if (item.body != null)
{
particleRotation += MathHelper.Pi;
mirrorAngle = true;
angle = item.body.Rotation + ((item.body.Dir > 0.0f) ? 0.0f : MathHelper.Pi);
particleRotation = -item.body.Rotation;
if (emitter.Prefab.Properties.CopyEntityDir && item.body.Dir < 0.0f)
{
particleRotation += MathHelper.Pi;
mirrorAngle = true;
}
}
else
{
angle = -item.RotationRad;
particleRotation = item.RotationRad;
}
entityAngleAssigned = true;
}
@@ -135,6 +143,7 @@ namespace Barotrauma
private void PlaySound(Entity entity, Hull hull, Vector2 worldPosition)
{
if (sounds.Count == 0) { return; }
if (entity is { Submarine.Loading: true }) { return; }
if (soundChannel == null || !soundChannel.IsPlaying || forcePlaySounds)
{
@@ -185,13 +194,8 @@ namespace Barotrauma
soundChannel.Position = new Vector3(worldPosition, 0.0f);
}
if (soundChannel != null && soundChannel.Looping)
{
ActiveLoopingSounds.Add(this);
soundEmitter = entity;
loopStartTime = Timing.TotalTime;
}
KeepLoopingSoundAlive(soundChannel);
void PlaySoundOrDelayIfNotLoaded(RoundSound selectedSound)
{
if (playSoundAfterLoadedCoroutine != null) { return; }
@@ -222,14 +226,28 @@ namespace Barotrauma
void PlaySound(RoundSound selectedSound)
{
//if the sound loops, we must make sure the existing channel
//if the sound loops, we must make sure the existing channel has been stopped first before attempting to play a new one
System.Diagnostics.Debug.Assert(
soundChannel == null || !soundChannel.IsPlaying || soundChannel.FadingOutAndDisposing || !soundChannel.Looping,
"A StatusEffect attempted to play a sound, but an looping sound is already playing. The looping sound should be stopped before playing a new one, or it will keep looping indefinitely.");
soundChannel = SoundPlayer.PlaySound(selectedSound.Sound, worldPosition, selectedSound.Volume, selectedSound.Range, hullGuess: hull, ignoreMuffling: selectedSound.IgnoreMuffling, freqMult: selectedSound.GetRandomFrequencyMultiplier());
ignoreMuffling = selectedSound.IgnoreMuffling;
if (soundChannel != null) { soundChannel.Looping = loopSound; }
if (soundChannel != null)
{
soundChannel.Looping = loopSound;
KeepLoopingSoundAlive(soundChannel);
}
}
void KeepLoopingSoundAlive(SoundChannel soundChannel)
{
if (soundChannel != null && soundChannel.Looping)
{
ActiveLoopingSounds.Add(this);
soundEmitter = entity;
loopStartTime = Timing.TotalTime;
}
}
}