@Wulf
current implementation of OnRecycleItem hook calling differs from previous one,
should we null the Blueprint now (but we cant) instead of returning False or what ever? Why this was changed?
compared to previousCode:if (Interface.CallHook("OnRecycleItem", (object) this, (object) slot2) != null) { if (!this.HasRecyclable()) { this.StopRecycling(); return; } } else if (!((UnityEngine.Object) slot2.info.Blueprint != (UnityEngine.Object) null)) continue;
Code:if (Interface.CallHook("OnRecycleItem", (object) this, (object) slot2) != null) { if (this.HasRecyclable()) return; this.StopRecycling(); return; }
Fixed OnRecycleItem hook behaviour changed
Discussion in 'Rust Development' started by wazzzup, Apr 28, 2018.
-
Wulf Community Admin
It has not changed. This is the current placement of it:
If you are self-patching, you're likely using an old version of the patcher and Oxide.Core.dll. -
redownloaded github.com/OxideMod/Oxide.Rust/releases/download/2.0.3904/Oxide.Rust.zip
-
Wulf Community Admin
Ahh, right... it has a patch too. So yes, the index for the patch was off, but is now fixed. Thanks for the report!
-
@Wulf sorry, but this can't be usable again (
Code:if (Interface.CallHook("OnRecycleItem", (object) this, (object) slot2) != null && !this.HasRecyclable()) { this.StopRecycling(); return; }
-
Wulf Community Admin
-
the whole thing is that if we manipulate item in recycler manually and return false on OnRecycleItem hook, current code is not breaking execution, but checks is there any items to recycle, but it's not correct.
should be as a few patches ago
Code:if (Interface.CallHook("OnRecycleItem", (object) this, (object) slot2) != null) { if (this.HasRecyclable()) return; this.StopRecycling(); return; }