MCJack123 / craftos2

A fast, modern, and feature-filled ComputerCraft emulator written in C++.

Home Page:https://www.craftos-pc.cc

Repository from Github https://github.comMCJack123/craftos2Repository from Github https://github.comMCJack123/craftos2

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

ShreksHellraiser opened this issue · 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