Skip to content

Commit

Permalink
Fixed issue when toSlot isn't provided
Browse files Browse the repository at this point in the history
  • Loading branch information
MCJack123 committed Mar 19, 2024
1 parent dbfc3a7 commit 20de96e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/generic_peripheral/inventory.hpp
Expand Up @@ -68,7 +68,7 @@ class inventory : public peripheral {
else src = p, dest = this;

if (fromSlot < 1 || fromSlot > src->size()) return luaL_error(L, "From slot out of range (between 1 and %d)", src->size());
if (!lua_isnil(L, 4) && (toSlot < 1 || toSlot > dest->size())) return luaL_error(L, "To slot out of range (between 1 and %d)", dest->size());
if (!lua_isnoneornil(L, 4) && (toSlot < 1 || toSlot > dest->size())) return luaL_error(L, "To slot out of range (between 1 and %d)", dest->size());
if (limit <= 0) {
lua_pushinteger(L, 0);
return 1;
Expand Down Expand Up @@ -103,4 +103,4 @@ class inventory : public peripheral {
}
};

#endif
#endif

0 comments on commit 20de96e

Please sign in to comment.