return true;
}
-bool ScriptApiItem::item_OnSecondaryUse(ItemStack &item, ServerActiveObject *user)
+bool ScriptApiItem::item_OnSecondaryUse(ItemStack &item,
+ ServerActiveObject *user, const PointedThing &pointed)
{
SCRIPTAPI_PRECHECKHEADER
LuaItemStack::create(L, item);
objectrefGetOrCreate(L, user);
- PointedThing pointed;
- pointed.type = POINTEDTHING_NOTHING;
pushPointedThing(pointed);
PCALL_RES(lua_pcall(L, 3, 1, error_handler));
if (!lua_isnil(L, -1)) {
const InventoryList *old_craft_grid, const InventoryLocation &craft_inv)
{
SCRIPTAPI_PRECHECKHEADER
-
+ sanity_check(old_craft_grid);
int error_handler = PUSH_ERROR_HANDLER(L);
lua_getglobal(L, "core");
return false;
}
-void ScriptApiItem::pushPointedThing(const PointedThing& pointed)
+void ScriptApiItem::pushPointedThing(const PointedThing &pointed, bool hitpoint)
{
lua_State* L = getStack();
- push_pointed_thing(L, pointed);
+ push_pointed_thing(L, pointed, false, hitpoint);
}