Moving camera with sub even if typing, server doesn't do impact damage to client characters, server sends cause of death in importantentityupdate if health<=0, fire sync fixes, lerping water surface in update instead of render,

This commit is contained in:
Regalis
2016-01-27 20:38:24 +02:00
parent 71faada355
commit 8cc12b6988
13 changed files with 111 additions and 45 deletions

View File

@@ -385,18 +385,20 @@ namespace Barotrauma
float impact = Vector2.Dot(avgVelocity, -normal);
if (GameMain.Server != null) impact = impact / 2.0f;
Limb l = (Limb)f1.Body.UserData;
float volume = stairs == null ? impact/5.0f : impact;
volume= Math.Min(impact, 1.0f);
float volume = stairs == null ? impact / 5.0f : impact;
volume = Math.Min(impact, 1.0f);
if (impact > 0.8f && l.HitSound != null && l.soundTimer <= 0.0f) l.HitSound.Play(volume, impact * 100.0f, l.WorldPosition);
if (impact > l.impactTolerance)
{
character.Health -= (impact - l.impactTolerance * 0.1f);
if (!character.IsNetworkPlayer)
{
character.AddDamage(CauseOfDeath.Damage, impact - l.impactTolerance * 0.1f);
}
strongestImpact = Math.Max(strongestImpact, impact - l.impactTolerance);
SoundPlayer.PlayDamageSound(DamageSoundType.LimbBlunt, strongestImpact, l.body);