fix vrcfallowrootfeatures

This commit is contained in:
Lillith Rose 2026-04-27 10:51:38 -04:00
parent f514f8f9c3
commit 391a0b307a
2 changed files with 13 additions and 8 deletions

View file

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 9e181fe0cfb2c3640b792ebaad469625
guid: 007a619efa189a0439e5dbed9693f9e1
TextureImporter:
internalIDToNameTable: []
externalObjects: {}

View file

@ -4,18 +4,22 @@ using UnityEditor;
using UnityEngine;
[InitializeOnLoad]
public static class VRCFAllowRootFeatures {
static VRCFAllowRootFeatures() {
public static class VRCFAllowRootFeatures
{
static VRCFAllowRootFeatures()
{
var harmony = new Harmony("gay.lilyy.VRCFAllowRootFeatures");
var featureFinderType = AccessTools.TypeByName("VF.Feature.Base.FeatureFinder");
var avatarHookType = AccessTools.TypeByName("VF.Hooks.VRCFuryAvatarHook");
if (featureFinderType == null) {
if (avatarHookType == null)
{
Debug.LogError("FeatureFinder type not found");
return;
}
var method = AccessTools.Method(featureFinderType, "AllowRootFeatures");
if (method == null) {
var method = AccessTools.Method(avatarHookType, "AllowRootFeatures");
if (method == null)
{
Debug.LogError("AllowRootFeatures method not found");
return;
}
@ -24,7 +28,8 @@ public static class VRCFAllowRootFeatures {
harmony.Patch(method, prefix: new HarmonyMethod(prefix));
}
private static bool Prefix(object gameObject, object avatarObject, ref bool __result) {
private static bool Prefix(object gameObject, ref bool __result)
{
__result = true;
return false;
}