mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Call on_secondary_use when object is right-clicked
This commit is contained in:
parent
3b0df9760b
commit
4d668f32a6
4 changed files with 15 additions and 7 deletions
|
@ -115,7 +115,8 @@ bool ScriptApiItem::item_OnUse(ItemStack &item,
|
|||
return true;
|
||||
}
|
||||
|
||||
bool ScriptApiItem::item_OnSecondaryUse(ItemStack &item, ServerActiveObject *user)
|
||||
bool ScriptApiItem::item_OnSecondaryUse(ItemStack &item,
|
||||
ServerActiveObject *user, const PointedThing &pointed)
|
||||
{
|
||||
SCRIPTAPI_PRECHECKHEADER
|
||||
|
||||
|
@ -126,8 +127,6 @@ bool ScriptApiItem::item_OnSecondaryUse(ItemStack &item, ServerActiveObject *use
|
|||
|
||||
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)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue