Rename isBlacklistedPool to IsBlacklistedPool; simplify transform check
Renamed PoolBlacklist.isBlacklistedPool to IsBlacklistedPool for C# naming consistency and updated all references. Simplified InPoolManagerTransform to check root object's name instead of path for improved reliability.
This commit is contained in:
@@ -43,7 +43,7 @@ namespace BoneSync.Patching
|
|||||||
if (pool.Prefab.GetComponent<Magazine>() != null) return true;
|
if (pool.Prefab.GetComponent<Magazine>() != null) return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
public static bool isBlacklistedPool(Pool pool)
|
public static bool IsBlacklistedPool(Pool pool)
|
||||||
{
|
{
|
||||||
if (_blacklistedCache.ContainsKey(pool))
|
if (_blacklistedCache.ContainsKey(pool))
|
||||||
return _blacklistedCache[pool];
|
return _blacklistedCache[pool];
|
||||||
@@ -76,7 +76,7 @@ namespace BoneSync.Patching
|
|||||||
{
|
{
|
||||||
if (CallPatchedMethods.allowPatchedMethodCall) return;
|
if (CallPatchedMethods.allowPatchedMethodCall) return;
|
||||||
if (__instance == null) return;
|
if (__instance == null) return;
|
||||||
if (PoolBlacklist.isBlacklistedPool(__instance)) return;
|
if (PoolBlacklist.IsBlacklistedPool(__instance)) return;
|
||||||
//SyncLogger.Msg("Patched Instantiating object in pool: " + __instance.name);
|
//SyncLogger.Msg("Patched Instantiating object in pool: " + __instance.name);
|
||||||
__result.onSpawnDelegate = Il2CppSystem.Delegate.Combine(__result.onSpawnDelegate, (Il2CppSystem.Action<GameObject>)((g) => { PooleePatches.OnSpawnPatchPost(__result); })).Cast<Il2CppSystem.Action<GameObject>>();
|
__result.onSpawnDelegate = Il2CppSystem.Delegate.Combine(__result.onSpawnDelegate, (Il2CppSystem.Action<GameObject>)((g) => { PooleePatches.OnSpawnPatchPost(__result); })).Cast<Il2CppSystem.Action<GameObject>>();
|
||||||
__result.onDespawnDelegate = Il2CppSystem.Delegate.Combine(__result.onDespawnDelegate, (Il2CppSystem.Action<GameObject>)((g) => { PooleePatches.OnDespawnPatchPost(__result); })).Cast<Il2CppSystem.Action<GameObject>>();
|
__result.onDespawnDelegate = Il2CppSystem.Delegate.Combine(__result.onDespawnDelegate, (Il2CppSystem.Action<GameObject>)((g) => { PooleePatches.OnDespawnPatchPost(__result); })).Cast<Il2CppSystem.Action<GameObject>>();
|
||||||
|
|||||||
@@ -269,11 +269,7 @@ namespace BoneSync.Sync.Components
|
|||||||
|
|
||||||
private bool InPoolManagerTransform()
|
private bool InPoolManagerTransform()
|
||||||
{
|
{
|
||||||
if (transform.GetPath().StartsWith("/Pool Manager/"))
|
return (transform.root.name == "Pool Manager");
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
public bool CanBeSynced()
|
public bool CanBeSynced()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user