Hi,
I'm making a plugin that in under specific circumstances gives you only half of the items you would normally get. For example when you pickup stone collectible it gives you only 25 stones instead of 50. But the problem is when you gather something like pumpkin. It normally yields 1 pumpkin and 1 pumpkin seed. But now it should yield half of it and that's half of an item. So what i did is that there's 50% chance it will give you 1 and 50% chance it will give you 0. But when i change the amount of an item to 0, it still gives the player the item with amount 0 and shows a red message in the stats bar. So i thought what if I return a non-null value to stop giving the item to the player. But if I return a non-null value the oxide completely breaks the loop so it doesnt even call the hook for the other item (seed) nor does it kill the pumpkin entity. So can you guys suggest me anything or edit oxide to somehow allow this ? Or can I commit to oxide repo to change this hook ?
EDIT: This problem also affects OnDispenserGather, OnGrowableGather and maybe something else too
OnCollectiblePickup problem
I've temporarely fixed this by decompiling Assembly-CSharp.dll, editing BasePlayer#GiveItem to do nothing if the item's amount is zero and recompiling it back. This works perfecetly but that's just a temporary solution because this gets removed with every update, so i would be very glad if something like this could be implemented in Oxide.