Qwiso / QMultiMod

Fully tweakable MultiMod for Subnautica
6 stars 6 forks source link

MapRoomFunctionality.get_mapScale patch doesn't seems to work... #4

Closed Vlad-00003 closed 6 years ago

Vlad-00003 commented 6 years ago

So, I was fighting with it for a while, but I used the different way for patching. Your way doesn't seems to work either.

https://github.com/pardeike/Harmony/issues/70

Vlad-00003 commented 6 years ago

Changing the code to this:

class MapRoomFunctionality_getMapScale_Patch
{
    public static bool Prefix(MapRoomFunctionality __instance, ref float __result)
    {
        FileLog.Log("get_mapScale called!");
        __result = __instance.hologramRadius / QMultiModSettings.Instance.ScannerBlipRange;
        return false;
    }
}

Does nothing, and the actuall map in the scanning room is clipping outside of the room...

Qwiso commented 6 years ago

I'm not sure what issue you're having with that patch, it's working

Make sure you change the config.json file, not just the code?

Qwiso commented 6 years ago

Here is 50f scale

image

Vlad-00003 commented 6 years ago

@Qwiso, wired af. As you can see the code I gave you - the FileLog.Log("get_mapScale called!"); isn't even being called for me... I was expiriancing this even then I was making my own version, so.... If everything is working for you - it looks like I have some problems on my side.

Qwiso commented 6 years ago

I'm not sure what method you're using to setup your patches but this is the important part

[HarmonyPatch(typeof(MapRoomFunctionality))]
[HarmonyPatch("mapScale", PropertyMethod.Getter)] //PropertyMethod.Getter
class MapRoomFunctionality_getMapScale_Patch {...}
Vlad-00003 commented 6 years ago

@Qwiso, dude, are you kidding me? I'm talking about your code. I've just added debug messages to this part, and that's it. It doesn't work for me for some reason.

Vlad-00003 commented 6 years ago

And, as You can see in the post I've mentioned - it also doesn't work with over way of patching. I have no idea why.