Fix 6.4 sigs.

This commit is contained in:
Ottermandias 2023-05-24 15:24:28 +02:00
parent e14fedf59e
commit 1a36b74557
2 changed files with 36 additions and 22 deletions

View file

@ -52,12 +52,12 @@ public static class Sigs
public const string ChangeCustomize = "E8 ?? ?? ?? ?? 41 0F B6 C5 66 41 89 86";
// PathResolver.PathState
public const string HumanVTable = "48 8D 05 ?? ?? ?? ?? 48 89 03 48 8D 8B ?? ?? ?? ?? 44 89 83 ?? ?? ?? ?? 48 8B C1";
public const string HumanVTable = "48 8D 05 ?? ?? ?? ?? 48 89 03 48 B8 ?? ?? ?? ?? ?? ?? ?? ?? 89 8B";
public const string WeaponVTable =
"48 8D 05 ?? ?? ?? ?? 48 89 03 B8 ?? ?? ?? ?? 66 89 83 ?? ?? ?? ?? 48 8B C3 48 89 8B ?? ?? ?? ?? 48 89 8B";
public const string DemiHumanVTable = "48 8D 05 ?? ?? ?? ?? 45 33 C0 48 89 03 BA";
public const string DemiHumanVTable = "48 8D 05 ?? ?? ?? ?? 48 89 03 48 8B C3 89 8B";
public const string MonsterVTable = "48 8D 05 ?? ?? ?? ?? 48 89 03 33 C0 48 89 83 ?? ?? ?? ?? 48 89 83 ?? ?? ?? ?? C7 83";
// PathResolver.Subfiles

View file

@ -25,7 +25,12 @@ public class MetaCache : IDisposable, IEnumerable<KeyValuePair<MetaManipulation,
private readonly ImcCache _imcCache = new();
public bool TryGetValue(MetaManipulation manip, [NotNullWhen(true)] out IMod? mod)
=> _manipulations.TryGetValue(manip, out mod);
{
lock (_manipulations)
{
return _manipulations.TryGetValue(manip, out mod);
}
}
public int Count
=> _manipulations.Count;
@ -84,11 +89,14 @@ public class MetaCache : IDisposable, IEnumerable<KeyValuePair<MetaManipulation,
=> Dispose();
public bool ApplyMod(MetaManipulation manip, IMod mod)
{
lock (_manipulations)
{
if (_manipulations.ContainsKey(manip))
_manipulations.Remove(manip);
_manipulations[manip] = mod;
}
if (!_manager.CharacterUtility.Ready)
return true;
@ -109,10 +117,13 @@ public class MetaCache : IDisposable, IEnumerable<KeyValuePair<MetaManipulation,
}
public bool RevertMod(MetaManipulation manip, [NotNullWhen(true)] out IMod? mod)
{
lock (_manipulations)
{
var ret = _manipulations.Remove(manip, out mod);
if (!_manager.CharacterUtility.Ready)
return ret;
}
// Imc manipulations do not require character utility,
// but they do require the file space to be ready.
@ -186,6 +197,8 @@ public class MetaCache : IDisposable, IEnumerable<KeyValuePair<MetaManipulation,
return;
var loaded = 0;
lock (_manipulations)
{
foreach (var manip in Manipulations)
{
loaded += manip.ManipulationType switch
@ -202,6 +215,7 @@ public class MetaCache : IDisposable, IEnumerable<KeyValuePair<MetaManipulation,
? 1
: 0;
}
}
_manager.ApplyDefaultFiles(_collection);
_manager.CharacterUtility.LoadingFinished -= ApplyStoredManipulations;