Unstable 0.17.5.0
This commit is contained in:
+15
-5
@@ -172,11 +172,21 @@ namespace Barotrauma
|
||||
SetCore(ContentPackageManager.WorkshopPackages.Core.FirstOrDefault(p => p.SteamWorkshopId == Core.SteamWorkshopId) ??
|
||||
ContentPackageManager.CorePackages.First());
|
||||
}
|
||||
SetRegular(Regular
|
||||
.Select(p => ContentPackageManager.RegularPackages.Contains(p)
|
||||
? p
|
||||
: ContentPackageManager.WorkshopPackages.Regular.FirstOrDefault(p2 => p2.SteamWorkshopId == p.SteamWorkshopId))
|
||||
.ToArray());
|
||||
|
||||
List<RegularPackage> newRegular = new List<RegularPackage>();
|
||||
foreach (var p in Regular)
|
||||
{
|
||||
if (ContentPackageManager.RegularPackages.Contains(p))
|
||||
{
|
||||
newRegular.Add(p);
|
||||
}
|
||||
else if (ContentPackageManager.WorkshopPackages.Regular.FirstOrDefault(p2
|
||||
=> p2.SteamWorkshopId == p.SteamWorkshopId) is { } newP)
|
||||
{
|
||||
newRegular.Add(newP);
|
||||
}
|
||||
}
|
||||
SetRegular(newRegular);
|
||||
}
|
||||
|
||||
public static void BackUp()
|
||||
|
||||
@@ -115,6 +115,24 @@ namespace Barotrauma
|
||||
}
|
||||
|
||||
public void Remove() => Element.Remove();
|
||||
|
||||
public override bool Equals(object? obj)
|
||||
{
|
||||
return obj is ContentXElement element && this == element;
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return HashCode.Combine(ContentPackage, Element);
|
||||
}
|
||||
|
||||
public static bool operator ==(in ContentXElement? a, in ContentXElement? b)
|
||||
{
|
||||
return a?.ContentPackage == b?.ContentPackage && a?.Element == b?.Element;
|
||||
}
|
||||
|
||||
public static bool operator !=(in ContentXElement? a, in ContentXElement? b) =>
|
||||
!(a == b);
|
||||
}
|
||||
|
||||
public static class ContentXElementExtensions
|
||||
|
||||
Reference in New Issue
Block a user