fix inventory.move_range
This commit is contained in:
parent
9e7bf705f2
commit
f5a4b5ca79
@ -18,7 +18,7 @@ public:
|
|||||||
|
|
||||||
Inventory(int64_t id, size_t size);
|
Inventory(int64_t id, size_t size);
|
||||||
|
|
||||||
Inventory(const Inventory& orig);
|
explicit Inventory(const Inventory& orig);
|
||||||
|
|
||||||
ItemStack& getSlot(size_t index);
|
ItemStack& getSlot(size_t index);
|
||||||
size_t findEmptySlot(size_t begin = 0, size_t end = -1) const;
|
size_t findEmptySlot(size_t begin = 0, size_t end = -1) const;
|
||||||
|
|||||||
@ -179,7 +179,7 @@ static int l_move_range(lua::State* L) {
|
|||||||
auto invBid = lua::tointeger(L, 3);
|
auto invBid = lua::tointeger(L, 3);
|
||||||
auto slotBegin = lua::isnoneornil(L, 4) ? -1 : lua::tointeger(L, 4);
|
auto slotBegin = lua::isnoneornil(L, 4) ? -1 : lua::tointeger(L, 4);
|
||||||
auto slotEnd = lua::isnoneornil(L, 5) ? -1 : lua::tointeger(L, 5) + 1;
|
auto slotEnd = lua::isnoneornil(L, 5) ? -1 : lua::tointeger(L, 5) + 1;
|
||||||
auto invB = get_inventory(invBid, 3);
|
auto& invB = get_inventory(invBid, 3);
|
||||||
auto& slot = invA.getSlot(slotAid);
|
auto& slot = invA.getSlot(slotAid);
|
||||||
if (slotBegin == -1) {
|
if (slotBegin == -1) {
|
||||||
invB.move(slot, *content->getIndices());
|
invB.move(slot, *content->getIndices());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user