Stat-field resolution cache is concurrent: parallel catalog opens corrupted the shared Dictionary
Two test classes opening the catalog at once threw 'concurrent update' from ValidateStatModifiers; the cache is static. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
cfba303afa
commit
7d1106a907
1 changed files with 2 additions and 2 deletions
|
|
@ -818,8 +818,8 @@ public static class StatValidation
|
||||||
// ApplyModifier threw an unhelpful NullReferenceException at random equip time. Resolving it here, once,
|
// ApplyModifier threw an unhelpful NullReferenceException at random equip time. Resolving it here, once,
|
||||||
// memoized, and failing loudly at catalog load or Upsert (through ValidateStatModifiers below) names the
|
// memoized, and failing loudly at catalog load or Upsert (through ValidateStatModifiers below) names the
|
||||||
// record instead of leaving the bug for whoever equips the item first.
|
// record instead of leaving the bug for whoever equips the item first.
|
||||||
private static readonly Dictionary<(string Target, string Stat), (Type Type, FieldInfo Field)> _resolvedStatFields =
|
private static readonly System.Collections.Concurrent.ConcurrentDictionary<(string Target, string Stat), (Type Type, FieldInfo Field)> _resolvedStatFields =
|
||||||
new Dictionary<(string, string), (Type, FieldInfo)>();
|
new System.Collections.Concurrent.ConcurrentDictionary<(string, string), (Type, FieldInfo)>();
|
||||||
|
|
||||||
private static Type[] _statReferenceTypes;
|
private static Type[] _statReferenceTypes;
|
||||||
private static Type[] StatReferenceTypes => _statReferenceTypes ??= typeof(BehaviorData).GetAllChildClasses()
|
private static Type[] StatReferenceTypes => _statReferenceTypes ??= typeof(BehaviorData).GetAllChildClasses()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue