Skip to content

Commit

Permalink
fat harvesting fix
Browse files Browse the repository at this point in the history
  • Loading branch information
DigitalzombieTLD committed Jul 4, 2023
1 parent 300e880 commit 834a853
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Candlelight.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 4 additions & 3 deletions Patches/Harmony.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using UnityEngine;
using Il2Cpp;
using UnityEngine.AddressableAssets;
using static Il2Cpp.PlayerManager;

namespace Candlelight
{
Expand Down Expand Up @@ -59,9 +60,9 @@ public static void Postfix(ref Panel_BodyHarvest __instance)
{
//GearItem gearItem = GameManager.GetPlayerManagerComponent().InstantiateItemInPlayerInventory("GEAR_FatRaw", false);
GearItem gearItem = Addressables.LoadAssetAsync<GameObject>("GEAR_FatRaw").WaitForCompletion().GetComponent<GearItem>();
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, ")"});
Expand Down
6 changes: 3 additions & 3 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]

0 comments on commit 834a853

Please sign in to comment.