summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--api.lua12
1 files changed, 10 insertions, 2 deletions
diff --git a/api.lua b/api.lua
index a9c68ff..57d4f26 100644
--- a/api.lua
+++ b/api.lua
@@ -1893,8 +1893,9 @@ local do_states = function(self, dtime)
p.y = p.y + (self.collisionbox[2] + self.collisionbox[5]) / 2
local obj = minetest.add_entity(p, self.arrow)
- if obj then
- local ent = obj:get_luaentity()
+ local ent = obj:get_luaentity()
+
+ if ent then
local amount = (vec.x * vec.x + vec.y * vec.y + vec.z * vec.z) ^ 0.5
local v = ent.velocity or 1 -- or set to default
ent.switch = 1
@@ -2990,6 +2991,13 @@ function mobs:register_egg(mob, desc, background, addegg, no_creative)
local pos = pointed_thing.above
+ -- am I clicking on something with existing on_rightclick function?
+ local under = minetest.get_node(pointed_thing.under)
+ local def = minetest.registered_nodes[under.name]
+ if def and def.on_rightclick then
+ return def.on_rightclick(pointed_thing.under, under, placer, itemstack)
+ end
+
if pos
and within_limits(pos, 0)
and not minetest.is_protected(pos, placer:get_player_name()) then