Skip to content

Commit 07ea6a9

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

File tree

1 file changed

+25
-0
lines changed

1 file changed

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

0 commit comments

Comments
 (0)