Skip to content

Commit 76b85e9

Browse files
author
Denys Khmara
committed
fix when prawn suit drilling doesn't save raw materials globally
1 parent b12b64c commit 76b85e9

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using System.Reflection;
2+
using NitroxClient.GameLogic;
3+
using NitroxModel.Core;
4+
using NitroxModel.Helper;
5+
using UnityEngine;
6+
7+
namespace NitroxPatcher.Patches.Dynamic;
8+
9+
/// <summary>
10+
/// Event when someone picks up an item.
11+
/// </summary>
12+
public sealed partial class ResourceTracker_OnPickedUp_Patch : NitroxPatch, IDynamicPatch
13+
{
14+
public static readonly MethodInfo TARGET_METHOD = Reflect.Method((ResourceTracker d) => d.OnPickedUp(default));
15+
16+
public static bool Prefix(ResourceTracker __instance)
17+
{
18+
TechType instanceTechType = __instance.techType;
19+
GameObject instanceGameObject = __instance.gameObject;
20+
if (instanceTechType != null && instanceGameObject != null)
21+
{
22+
Resolve<Items>().PickedUp(instanceGameObject, instanceTechType);
23+
}
24+
return true;
25+
}
26+
}

0 commit comments

Comments
 (0)