Reapply "OBT1.1.0 Merge branch 'dev_pte' into dev"

This reverts commit 046483b9da.
This commit is contained in:
NotAlwaysTrue
2026-04-30 21:59:54 +08:00
parent 02689d0d86
commit 25683dcf39
85 changed files with 2413 additions and 779 deletions
@@ -1,6 +1,8 @@
using Barotrauma.Abilities;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Threading;
namespace Barotrauma
{
@@ -72,7 +74,9 @@ namespace Barotrauma
}
}
private static readonly HashSet<Identifier> checkedNonStackableTalents = new();
// ThreadLocal for thread-safe talent checking
private static readonly ThreadLocal<HashSet<Identifier>> checkedNonStackableTalentsLocal = new ThreadLocal<HashSet<Identifier>>(() => new HashSet<Identifier>());
private static HashSet<Identifier> checkedNonStackableTalents => checkedNonStackableTalentsLocal.Value;
/// <summary>
/// Checks talents for a given AbilityObject taking into account non-stackable talents.