(43a58c2c3) Fixed content package hash calculation failing if the package is not enabled and contains new monster files. Was caused by Character.GetConfigFile failing to find the config file because it only searched from currently selected content packages.
This commit is contained in:
@@ -150,63 +150,34 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (localPos.Animation != serverPos.Animation)
|
|
||||||
{
|
|
||||||
if (serverPos.Animation == AnimController.Animation.CPR)
|
|
||||||
{
|
|
||||||
character.AnimController.Anim = AnimController.Animation.CPR;
|
|
||||||
}
|
}
|
||||||
else if (character.AnimController.Anim == AnimController.Animation.CPR)
|
|
||||||
{
|
if (character.MemLocalState.Count > 120) character.MemLocalState.RemoveRange(0, character.MemLocalState.Count - 120);
|
||||||
character.AnimController.Anim = AnimController.Animation.None;
|
character.MemState.Clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Hull serverHull = Hull.FindHull(ConvertUnits.ToDisplayUnits(serverPos.Position), character.CurrentHull, serverPos.Position.Y < lowestSubPos);
|
partial void ImpactProjSpecific(float impact, Body body)
|
||||||
Hull clientHull = Hull.FindHull(ConvertUnits.ToDisplayUnits(localPos.Position), serverHull, localPos.Position.Y < lowestSubPos);
|
{
|
||||||
|
float volume = MathHelper.Clamp(impact - 3.0f, 0.5f, 1.0f);
|
||||||
|
|
||||||
if (serverHull != null && clientHull != null && serverHull.Submarine != clientHull.Submarine)
|
if (body.UserData is Limb limb && character.Stun <= 0f)
|
||||||
{
|
{
|
||||||
//hull subs don't match => teleport the camera to the other sub
|
if (impact > 3.0f) { PlayImpactSound(limb); }
|
||||||
character.Submarine = serverHull.Submarine;
|
|
||||||
character.CurrentHull = currentHull = serverHull;
|
|
||||||
SetPosition(serverPos.Position);
|
|
||||||
character.MemLocalState.Clear();
|
|
||||||
}
|
}
|
||||||
else
|
else if (body.UserData is Limb || body == Collider.FarseerBody)
|
||||||
{
|
{
|
||||||
Vector2 positionError = serverPos.Position - localPos.Position;
|
if (!character.IsRemotePlayer && impact > ImpactTolerance)
|
||||||
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);
|
SoundPlayer.PlayDamageSound("LimbBlunt", strongestImpact, Collider);
|
||||||
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.Controlled == character)
|
||||||
|
{
|
||||||
|
GameMain.GameScreen.Cam.Shake = Math.Min(Math.Max(strongestImpact, GameMain.GameScreen.Cam.Shake), 3.0f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if (character.MemState.Count < 1) return;
|
if (character.MemState.Count < 1) return;
|
||||||
|
|
||||||
overrideTargetMovement = Vector2.Zero;
|
overrideTargetMovement = Vector2.Zero;
|
||||||
|
|||||||
@@ -521,12 +521,21 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the file paths of all files of the given type in the currently selected content packages.
|
/// Returns the file paths of all files of the given type in the content packages.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public IEnumerable<string> GetFilesOfType(ContentType type)
|
/// <param name="type"></param>
|
||||||
|
/// <param name="searchAllContentPackages">If true, also returns files in content packages that are installed but not currently selected.</param>
|
||||||
|
public IEnumerable<string> GetFilesOfType(ContentType type, bool searchAllContentPackages = false)
|
||||||
|
{
|
||||||
|
if (searchAllContentPackages)
|
||||||
|
{
|
||||||
|
return ContentPackage.GetFilesOfType(ContentPackage.List, type);
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
return ContentPackage.GetFilesOfType(SelectedPackages, type);
|
return ContentPackage.GetFilesOfType(SelectedPackages, type);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Allows the game to run logic such as updating the world,
|
/// Allows the game to run logic such as updating the world,
|
||||||
|
|||||||
@@ -145,6 +145,23 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the file paths of all files of the given type in the content packages.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="type"></param>
|
||||||
|
/// <param name="searchAllContentPackages">If true, also returns files in content packages that are installed but not currently selected.</param>
|
||||||
|
public IEnumerable<string> GetFilesOfType(ContentType type, bool searchAllContentPackages = false)
|
||||||
|
{
|
||||||
|
if (searchAllContentPackages)
|
||||||
|
{
|
||||||
|
return ContentPackage.GetFilesOfType(ContentPackage.List, type);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return ContentPackage.GetFilesOfType(SelectedPackages, type);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the file paths of all files of the given type in the currently selected content packages.
|
/// Returns the file paths of all files of the given type in the currently selected content packages.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -853,7 +853,7 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
if (characterConfigFiles == null)
|
if (characterConfigFiles == null)
|
||||||
{
|
{
|
||||||
characterConfigFiles = GameMain.Instance.GetFilesOfType(ContentType.Character);
|
characterConfigFiles = GameMain.Instance.GetFilesOfType(ContentType.Character, searchAllContentPackages: true);
|
||||||
}
|
}
|
||||||
return characterConfigFiles;
|
return characterConfigFiles;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user