(bb8bbd4d3) Don't mute footstep sounds in the character editor
This commit is contained in:
@@ -123,66 +123,6 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Hull serverHull = Hull.FindHull(ConvertUnits.ToDisplayUnits(serverPos.Position), character.CurrentHull, serverPos.Position.Y < lowestSubPos);
|
|
||||||
Hull clientHull = Hull.FindHull(ConvertUnits.ToDisplayUnits(localPos.Position), serverHull, localPos.Position.Y < lowestSubPos);
|
|
||||||
|
|
||||||
if (serverHull != null && clientHull != null && serverHull.Submarine != clientHull.Submarine)
|
|
||||||
{
|
|
||||||
//hull subs don't match => teleport the camera to the other sub
|
|
||||||
character.Submarine = serverHull.Submarine;
|
|
||||||
character.CurrentHull = currentHull = serverHull;
|
|
||||||
SetPosition(serverPos.Position);
|
|
||||||
character.MemLocalState.Clear();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Vector2 positionError = serverPos.Position - localPos.Position;
|
|
||||||
float rotationError = serverPos.Rotation.HasValue && localPos.Rotation.HasValue ?
|
|
||||||
serverPos.Rotation.Value - localPos.Rotation.Value :
|
|
||||||
0.0f;
|
|
||||||
|
|
||||||
for (int i = localPosIndex; i < character.MemLocalState.Count; i++)
|
|
||||||
{
|
|
||||||
Hull pointHull = Hull.FindHull(ConvertUnits.ToDisplayUnits(character.MemLocalState[i].Position), clientHull, character.MemLocalState[i].Position.Y < lowestSubPos);
|
|
||||||
if (pointHull != clientHull && ((pointHull == null) || (clientHull == null) || (pointHull.Submarine == clientHull.Submarine))) break;
|
|
||||||
character.MemLocalState[i].Translate(positionError, rotationError);
|
|
||||||
}
|
|
||||||
|
|
||||||
float errorMagnitude = positionError.Length();
|
|
||||||
if (errorMagnitude > 0.01f)
|
|
||||||
{
|
|
||||||
Collider.TargetPosition = Collider.SimPosition + positionError;
|
|
||||||
Collider.TargetRotation = Collider.Rotation + rotationError;
|
|
||||||
Collider.MoveToTargetPosition(lerp: true);
|
|
||||||
if (errorMagnitude > 0.5f)
|
|
||||||
{
|
|
||||||
character.MemLocalState.Clear();
|
|
||||||
foreach (Limb limb in Limbs)
|
|
||||||
{
|
|
||||||
limb.body.TargetPosition = limb.body.SimPosition + positionError;
|
|
||||||
limb.body.MoveToTargetPosition(lerp: true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if (character.MemLocalState.Count > 120) character.MemLocalState.RemoveRange(0, character.MemLocalState.Count - 120);
|
|
||||||
character.MemState.Clear();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
partial void ImpactProjSpecific(float impact, Body body)
|
|
||||||
{
|
|
||||||
float volume = MathHelper.Clamp(impact - 3.0f, 0.5f, 1.0f);
|
|
||||||
|
|
||||||
if (body.UserData is Limb && character.Stun <= 0f)
|
|
||||||
{
|
|
||||||
Limb limb = (Limb)body.UserData;
|
|
||||||
if (impact > 3.0f && limb.LastImpactSoundTime < Timing.TotalTime - Limb.SoundInterval)
|
|
||||||
{
|
|
||||||
PlayImpactSound(limb);
|
|
||||||
}
|
}
|
||||||
character.MemLocalState.Clear();
|
character.MemLocalState.Clear();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,7 +92,6 @@ namespace Barotrauma
|
|||||||
|
|
||||||
SoundPlayer.OverrideMusicType = "none";
|
SoundPlayer.OverrideMusicType = "none";
|
||||||
SoundPlayer.OverrideMusicDuration = null;
|
SoundPlayer.OverrideMusicDuration = null;
|
||||||
GameMain.SoundManager.SetCategoryGainMultiplier("default", 0.0f);
|
|
||||||
GameMain.SoundManager.SetCategoryGainMultiplier("waterambience", 0.0f);
|
GameMain.SoundManager.SetCategoryGainMultiplier("waterambience", 0.0f);
|
||||||
|
|
||||||
GUI.ForceMouseOn(null);
|
GUI.ForceMouseOn(null);
|
||||||
@@ -184,7 +183,6 @@ namespace Barotrauma
|
|||||||
base.Deselect();
|
base.Deselect();
|
||||||
|
|
||||||
SoundPlayer.OverrideMusicType = null;
|
SoundPlayer.OverrideMusicType = null;
|
||||||
GameMain.SoundManager.SetCategoryGainMultiplier("default", GameMain.Config.SoundVolume);
|
|
||||||
GameMain.SoundManager.SetCategoryGainMultiplier("waterambience", GameMain.Config.SoundVolume);
|
GameMain.SoundManager.SetCategoryGainMultiplier("waterambience", GameMain.Config.SoundVolume);
|
||||||
|
|
||||||
GUI.ForceMouseOn(null);
|
GUI.ForceMouseOn(null);
|
||||||
|
|||||||
Reference in New Issue
Block a user