return 0;
// Push callback function on stack
- if(!getItemCallback(ndef->get(node).name.c_str(),
- "allow_metadata_inventory_move"))
+ std::string nodename = ndef->get(node).name;
+ if(!getItemCallback(nodename.c_str(), "allow_metadata_inventory_move"))
return count;
// function(pos, from_list, from_index, to_list, to_index, count, player)
scriptError();
lua_remove(L, errorhandler); // Remove error handler
if(!lua_isnumber(L, -1))
- throw LuaError(NULL, "allow_metadata_inventory_move should return a number");
+ throw LuaError(NULL, "allow_metadata_inventory_move should"
+ " return a number, guilty node: " + nodename);
int num = luaL_checkinteger(L, -1);
lua_pop(L, 1); // Pop integer
return num;
return 0;
// Push callback function on stack
- if(!getItemCallback(ndef->get(node).name.c_str(),
- "allow_metadata_inventory_put"))
+ std::string nodename = ndef->get(node).name;
+ if(!getItemCallback(nodename.c_str(), "allow_metadata_inventory_put"))
return stack.count;
// Call function(pos, listname, index, stack, player)
scriptError();
lua_remove(L, errorhandler); // Remove error handler
if(!lua_isnumber(L, -1))
- throw LuaError(NULL, "allow_metadata_inventory_put should return a number");
+ throw LuaError(NULL, "allow_metadata_inventory_put should"
+ " return a number, guilty node: " + nodename);
int num = luaL_checkinteger(L, -1);
lua_pop(L, 1); // Pop integer
return num;
return 0;
// Push callback function on stack
- if(!getItemCallback(ndef->get(node).name.c_str(),
- "allow_metadata_inventory_take"))
+ std::string nodename = ndef->get(node).name;
+ if(!getItemCallback(nodename.c_str(), "allow_metadata_inventory_take"))
return stack.count;
// Call function(pos, listname, index, count, player)
scriptError();
lua_remove(L, errorhandler); // Remove error handler
if(!lua_isnumber(L, -1))
- throw LuaError(NULL, "allow_metadata_inventory_take should return a number");
+ throw LuaError(NULL, "allow_metadata_inventory_take should"
+ " return a number, guilty node: " + nodename);
int num = luaL_checkinteger(L, -1);
lua_pop(L, 1); // Pop integer
return num;
return;
// Push callback function on stack
- if(!getItemCallback(ndef->get(node).name.c_str(),
- "on_metadata_inventory_move"))
+ std::string nodename = ndef->get(node).name;
+ if(!getItemCallback(nodename.c_str(), "on_metadata_inventory_move"))
return;
// function(pos, from_list, from_index, to_list, to_index, count, player)
return;
// Push callback function on stack
- if(!getItemCallback(ndef->get(node).name.c_str(),
- "on_metadata_inventory_put"))
+ std::string nodename = ndef->get(node).name;
+ if(!getItemCallback(nodename.c_str(), "on_metadata_inventory_put"))
return;
// Call function(pos, listname, index, stack, player)
return;
// Push callback function on stack
- if(!getItemCallback(ndef->get(node).name.c_str(),
- "on_metadata_inventory_take"))
+ std::string nodename = ndef->get(node).name;
+ if(!getItemCallback(nodename.c_str(), "on_metadata_inventory_take"))
return;
// Call function(pos, listname, index, stack, player)