v0.12.0.2

This commit is contained in:
Joonas Rikkonen
2021-02-10 17:08:21 +02:00
parent 5c80a59bdd
commit 694cdfee7b
353 changed files with 12897 additions and 5028 deletions
@@ -450,16 +450,19 @@ namespace Barotrauma
#endif
if (Level.Loaded == null) { return; }
float submarineDepth = submarine.RealWorldDepth;
if (submarineDepth < Level.Loaded.RealWorldCrushDepth) { return; }
if (!Submarine.AtDamageDepth) { return; }
depthDamageTimer -= deltaTime;
if (depthDamageTimer > 0.0f) { return; }
foreach (Structure wall in Structure.WallList)
{
if (wall.Submarine != submarine || wall.CrushDepth > submarineDepth) { continue; }
if (wall.Submarine != submarine) { continue; }
float pastCrushDepth = submarineDepth - wall.CrushDepth;
float wallCrushDepth = wall.CrushDepth;
if (submarine.Info.SubmarineClass == SubmarineClass.DeepDiver) { wallCrushDepth *= 1.2f; }
float pastCrushDepth = submarine.RealWorldDepth - wallCrushDepth;
if (pastCrushDepth < 0) { return; }
Explosion.RangedStructureDamage(wall.WorldPosition, 100.0f, pastCrushDepth * 0.1f, levelWallDamage: 0.0f);
if (Character.Controlled != null && Character.Controlled.Submarine == submarine)
{