v1.4.4.1 (Blood in the Water Update)
This commit is contained in:
+12
-2
@@ -14,6 +14,7 @@ namespace Barotrauma
|
||||
|
||||
public override void LoadFile()
|
||||
{
|
||||
ClearCaches();
|
||||
XDocument doc = XMLExtensions.TryLoadXml(Path);
|
||||
if (doc == null)
|
||||
{
|
||||
@@ -36,6 +37,15 @@ namespace Barotrauma
|
||||
public override void UnloadFile()
|
||||
{
|
||||
CharacterPrefab.Prefabs.RemoveByFile(this);
|
||||
ClearCaches();
|
||||
}
|
||||
|
||||
private static void ClearCaches()
|
||||
{
|
||||
// Clear the caches to get rid of any overrides.
|
||||
// Variants should have their own params instances, but let's keep it simple and play safe.
|
||||
RagdollParams.ClearCache();
|
||||
AnimationParams.ClearCache();
|
||||
}
|
||||
|
||||
public override void Sort()
|
||||
@@ -60,11 +70,11 @@ namespace Barotrauma
|
||||
{
|
||||
if (humanoid)
|
||||
{
|
||||
ragdollParams = RagdollParams.GetRagdollParams<HumanRagdollParams>(speciesName);
|
||||
ragdollParams = RagdollParams.GetDefaultRagdollParams<HumanRagdollParams>(speciesName, mainElement, ContentPackage);
|
||||
}
|
||||
else
|
||||
{
|
||||
ragdollParams = RagdollParams.GetRagdollParams<FishRagdollParams>(speciesName);
|
||||
ragdollParams = RagdollParams.GetDefaultRagdollParams<FishRagdollParams>(speciesName, mainElement, ContentPackage);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
#nullable enable
|
||||
|
||||
namespace Barotrauma
|
||||
{
|
||||
internal sealed class ContainerTagFile : GenericPrefabFile<ContainerTagPrefab>
|
||||
{
|
||||
public ContainerTagFile(ContentPackage contentPackage, ContentPath path) : base(contentPackage, path) { }
|
||||
|
||||
protected override bool MatchesSingular(Identifier identifier) => identifier == "containertag";
|
||||
protected override bool MatchesPlural(Identifier identifier) => identifier == "containertags";
|
||||
protected override PrefabCollection<ContainerTagPrefab> Prefabs => ContainerTagPrefab.Prefabs;
|
||||
|
||||
protected override ContainerTagPrefab CreatePrefab(ContentXElement element)
|
||||
=> new(element, this);
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
using System.Collections.Immutable;
|
||||
using System.Collections.Immutable;
|
||||
using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
|
||||
@@ -37,7 +37,8 @@ namespace Barotrauma
|
||||
if (newList.Count != 0) { TextManager.TextPacks.TryAdd(kvp.Key, newList); }
|
||||
}
|
||||
TextManager.IncrementLanguageVersion();
|
||||
if (!TextManager.TextPacks.ContainsKey(GameSettings.CurrentConfig.Language))
|
||||
if (!TextManager.TextPacks.ContainsKey(GameSettings.CurrentConfig.Language) &&
|
||||
GameSettings.CurrentConfig.Language != TextManager.DefaultLanguage)
|
||||
{
|
||||
DebugConsole.AddWarning($"The language {GameSettings.CurrentConfig.Language} is no longer available. Switching to {TextManager.DefaultLanguage}...");
|
||||
var config = GameSettings.CurrentConfig;
|
||||
|
||||
Reference in New Issue
Block a user