- Added pre-touch to the ContentPath.FullPath to make them thread-safe.

This commit is contained in:
MapleWheels
2026-02-09 15:52:37 -05:00
parent 70e98467e8
commit 511f98ec18
2 changed files with 33 additions and 3 deletions
@@ -99,12 +99,13 @@ namespace Barotrauma
public static ContentPath FromRaw(ContentPackage? contentPackage, string? rawValue)
{
var newRaw = new ContentPath(contentPackage, rawValue);
if (prevCreatedRaw is not null && prevCreatedRaw.ContentPackage == contentPackage &&
// Removed as this almost never happens but makes the constructor not thread-safe.
/*if (prevCreatedRaw is not null && prevCreatedRaw.ContentPackage == contentPackage &&
prevCreatedRaw.RawValue == rawValue)
{
newRaw.cachedValue = prevCreatedRaw.Value;
}
prevCreatedRaw = newRaw;
prevCreatedRaw = newRaw;*/
return newRaw;
}
@@ -158,4 +159,4 @@ namespace Barotrauma
public override string? ToString() => Value;
}
}
}