1. Hey.

    Is the signature of the OnItemDropped in the Oxide API documentation correct?

    If I use it with the signature provided in the documentation it throws a InvalidCastException.

    I've checked on the types and those are Item and DroppedItem as it is stated in one of the changelogs.

    So I guess the documentation entry is outdated?

    Greetings

    David

    ps: Im not sure if this is the correct subforum to post this. If im wrong sorry in advance.
     
  2. Wulf

    Wulf Community Admin

    Could you show the exact error please?
     
  3. Sure.

    Signature: void OnItemDropped(Deployer deployer, BaseEntity entity) as stated in Oxide Rust API

    Error: (19:39:59) | Failed to call hook 'OnItemDropped' on plugin 'InsertPluginNameHere v0.1.0' (InvalidCastException: Cannot cast from source type to destination type.)

    Changing both parameters in the signature to object and putting the GetType() to Console says:

    First parameter type: Item

    Second parameter type: DroppedItem

    Changing the signature of the hook to said types and it works like a charm.
     
  4. Wulf

    Wulf Community Admin

    Yeah, noticed that in the patcher just now. I'll update the docs, not sure why it was off. Thanks for the report!
     
  5. No problem :)