mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 11:31:49 +00:00
refactor
This commit is contained in:
parent
b1740bf7eb
commit
4306573320
7 changed files with 26 additions and 24 deletions
|
|
@ -80,7 +80,7 @@ static int l_add(lua::State* L) {
|
|||
|
||||
auto& inv = get_inventory(invid);
|
||||
ItemStack item(itemid, count);
|
||||
inv.move(item, indices);
|
||||
inv.move(item, *indices);
|
||||
return lua::pushinteger(L, item.getCount());
|
||||
}
|
||||
|
||||
|
|
@ -144,9 +144,9 @@ static int l_move(lua::State* L) {
|
|||
auto& invB = get_inventory(invBid, 3);
|
||||
auto& slot = invA.getSlot(slotAid);
|
||||
if (slotBid == -1) {
|
||||
invB.move(slot, content->getIndices());
|
||||
invB.move(slot, *content->getIndices());
|
||||
} else {
|
||||
invB.move(slot, content->getIndices(), slotBid, slotBid + 1);
|
||||
invB.move(slot, *content->getIndices(), slotBid, slotBid + 1);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -163,9 +163,9 @@ static int l_move_range(lua::State* L) {
|
|||
auto invB = get_inventory(invBid, 3);
|
||||
auto& slot = invA.getSlot(slotAid);
|
||||
if (slotBegin == -1) {
|
||||
invB.move(slot, content->getIndices());
|
||||
invB.move(slot, *content->getIndices());
|
||||
} else {
|
||||
invB.move(slot, content->getIndices(), slotBegin, slotEnd);
|
||||
invB.move(slot, *content->getIndices(), slotBegin, slotEnd);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue