mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 11:31:49 +00:00
fix libinventory.move bug (none checking)
This commit is contained in:
parent
4d290a58fc
commit
2c9cb8b3d4
1 changed files with 4 additions and 1 deletions
|
|
@ -1,7 +1,10 @@
|
|||
#include <iostream>
|
||||
|
||||
#include "content/Content.hpp"
|
||||
#include "items/Inventories.hpp"
|
||||
#include "items/ItemStack.hpp"
|
||||
#include "logic/BlocksController.hpp"
|
||||
#include "logic/scripting/lua/lua_util.hpp"
|
||||
#include "world/Level.hpp"
|
||||
#include "api_lua.hpp"
|
||||
|
||||
|
|
@ -180,7 +183,7 @@ static int l_move(lua::State* L) {
|
|||
validate_slotid(slotAid, invA);
|
||||
|
||||
auto invBid = lua::tointeger(L, 3);
|
||||
auto slotBid = lua::isnil(L, 4) ? -1 : lua::tointeger(L, 4);
|
||||
auto slotBid = lua::isnoneornil(L, 4) ? -1 : lua::tointeger(L, 4);
|
||||
auto& invB = get_inventory(invBid, 3);
|
||||
auto& slot = invA.getSlot(slotAid);
|
||||
if (slotBid == -1) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue