Hello everyone!
I've recently made a new plugin - Quarry Craft for Rust | Oxide
But there is a problem.
Here is what I'm doing:
So.... everything works like a charm with any blueprint, that exists in game, but with the non-existing one the client getting NRE
- Creating the blueprint, that doesn't exists in game anymore
- By the command createing a new craft entry with the new blueprint
- Calling the hook
- Enqueueing my custom task
![]()
At the game code we can see this:
And I don't know how PlayerPerfs work at all. Is this a client-side thing? Cos I think that this is what causes NRE.Code:public static int GetCraftCount(ItemBlueprint x) { int num1 = 0; if (LocalPlayer.CraftCounts.TryGetValue(x.targetItem.itemid, out num1)) return num1; int num2 = PlayerPrefs.GetInt(string.Format("craftcount.{0}", (object) x.targetItem.shortname), 0); LocalPlayer.CraftCounts.Add(x.targetItem.itemid, num2); return num2; } public static void AddCraftCount(ItemBlueprint x) { int num = LocalPlayer.GetCraftCount(x) + 1; LocalPlayer.CraftCounts[x.targetItem.itemid] = num; PlayerPrefs.SetInt(string.Format("craftcount.{0}", (object) x.targetItem.shortname), num); }
As I mention before - any over bp that exists doesn't create the NRE.
Client NRE on craft
Discussion in 'Rust Development' started by Vlad-00003, Dec 9, 2017.