From 834a85378c0407b8aeaeb2f57783d866d1da1b91 Mon Sep 17 00:00:00 2001 From: DigitalzombieTLD Date: Tue, 4 Jul 2023 02:56:17 +0200 Subject: [PATCH] fat harvesting fix --- Candlelight.cs | 2 +- Patches/Harmony.cs | 7 ++++--- Properties/AssemblyInfo.cs | 6 +++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Candlelight.cs b/Candlelight.cs index 7a0ab82..d8cb496 100644 --- a/Candlelight.cs +++ b/Candlelight.cs @@ -15,7 +15,7 @@ public class Candlelight_Main : MelonMod public int layerMask = 0; public static RaycastHit hit; - public override void OnApplicationStart() + public override void OnInitializeMelon() { Candlelight.Settings.OnLoad(); layerMask |= 1 << 17; // gear layer diff --git a/Patches/Harmony.cs b/Patches/Harmony.cs index 836c024..8a675dc 100644 --- a/Patches/Harmony.cs +++ b/Patches/Harmony.cs @@ -3,6 +3,7 @@ using UnityEngine; using Il2Cpp; using UnityEngine.AddressableAssets; +using static Il2Cpp.PlayerManager; namespace Candlelight { @@ -59,9 +60,9 @@ public static void Postfix(ref Panel_BodyHarvest __instance) { //GearItem gearItem = GameManager.GetPlayerManagerComponent().InstantiateItemInPlayerInventory("GEAR_FatRaw", false); GearItem gearItem = Addressables.LoadAssetAsync("GEAR_FatRaw").WaitForCompletion().GetComponent(); - GameManager.GetPlayerManagerComponent().InstantiateItemInPlayerInventory(gearItem, 1, -1f, false, false); - - if (!msgAdded) + GameManager.GetPlayerManagerComponent().InstantiateItemInPlayerInventory(gearItem, 1, 1f, InventoryInstantiateFlags.None); + + if (!msgAdded) { msgAdded = true; string message = string.Concat(new object[] { gearItem.DisplayName, " (", fatReward, ")"}); diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index 9533426..66b13f2 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -10,9 +10,9 @@ //Version numbers in C# are a set of 1 to 4 positive integers separated by periods. //Mods typically use 3 numbers. For example: 1.2.1 //The mod version need specified in three places. -[assembly: AssemblyVersion("1.3.8")] -[assembly: AssemblyFileVersion("1.3.8")] -[assembly: MelonInfo(typeof(Candlelight_Main), "Candlelight", "1.3.8", "Digitalzombie", null)] +[assembly: AssemblyVersion("1.4.0")] +[assembly: AssemblyFileVersion("1.4.0")] +[assembly: MelonInfo(typeof(Candlelight_Main), "Candlelight", "1.4.0", "Digitalzombie", null)] //This tells MelonLoader that the mod is only for The Long Dark. [assembly: MelonGame("Hinterland", "TheLongDark")] \ No newline at end of file