Some visual effects when drowning or being killed by pressure

This commit is contained in:
Regalis
2016-02-19 15:00:45 +02:00
parent b49641ecb8
commit c59a2b5207
9 changed files with 66 additions and 11 deletions

View File

@@ -270,7 +270,11 @@ namespace Barotrauma
fireSource.Remove();
}
if (soundIndex > -1) Sounds.SoundManager.Stop(soundIndex);
if (soundIndex > -1)
{
Sounds.SoundManager.Stop(soundIndex);
soundIndex = -1;
}
//renderer.Dispose();
@@ -344,7 +348,11 @@ namespace Barotrauma
}
else
{
if (soundIndex > -1) Sounds.SoundManager.Stop(soundIndex);
if (soundIndex > -1)
{
Sounds.SoundManager.Stop(soundIndex);
soundIndex = -1;
}
}
//update client hulls if the amount of water has changed by >10%
@@ -353,7 +361,12 @@ namespace Barotrauma
new Networking.NetworkEvent(ID, false);
lastSentVolume = volume;
}
if (!update) return;
if (!update)
{
lethalPressure = 0.0f;
return;
}
float surfaceY = rect.Y - rect.Height + Volume / rect.Width;
for (int i = 0; i < waveY.Length; i++)