Fixed OnCropGather item is null

Discussion in 'Rust Development' started by CaseMan, Apr 10, 2018.

  1. item is NULL because the hook must be later
    Now:
    Code:
            if (!this.plantProperty.pickupItem.condition.enabled)
            {
                ItemDefinition itemDefinition = this.plantProperty.pickupItem;
                long num1 = (long)0;
                Interface.CallHook("OnCropGather", this, item, msg.player);
                item = ItemManager.Create(itemDefinition, num, (ulong)num1);
                msg.player.GiveItem(item, BaseEntity.GiveItemReason.PickedUp);
            }
    Need:
    Code:
            if (!this.plantProperty.pickupItem.condition.enabled)
            {
                ItemDefinition itemDefinition = this.plantProperty.pickupItem;
                long num1 = (long)0;
                item = ItemManager.Create(itemDefinition, num, (ulong)num1);
                Interface.CallHook("OnCropGather", this, item, msg.player);
                msg.player.GiveItem(item, BaseEntity.GiveItemReason.PickedUp);
            }
     
  2. Wulf

    Wulf Community Admin

    This has been fixed for then next update today.