craftos2 icon indicating copy to clipboard operation
craftos2 copied to clipboard

Inventory peripherals `setItem` call reports incorrect field names in errors

Open MasonGulu opened this issue 6 months ago • 0 comments

Describe the bug When calling setItem on a virtual inventory peripheral the error message for missing the "count" field is incorrect. It states "bad field 'name' (expected string, got nil)".

To Reproduce

  1. Attach a chest, attach left chest
  2. Wrap it as a peripheral in the lua prompt p = peripheral.wrap("left")
  3. Set an item missing the count field p.setItem(1, {name="test"})

Expected behavior The error should state that the count field is missing, not the name field.

Screenshots image

Environment (please complete the following information):

  • OS: PopOS 22.04
  • OS Version: 22.04
  • CraftOS-PC Version: v2.8.3
  • Compiled from source? No

MasonGulu avatar Aug 20 '24 23:08 MasonGulu