mirror of
https://github.com/minetest-mods/throwing.git
synced 2024-09-27 15:00:21 +02:00
Add public throwing.make_arrow_def
It was removed in b9c78c9
, leaving no way for other mods to use
the arrow_step function.
This commit is contained in:
parent
edeba9de8b
commit
6571ee4562
8
init.lua
8
init.lua
|
@ -207,6 +207,14 @@ local function arrow_step(self, dtime)
|
|||
self.last_pos = pos -- Used by the build arrow
|
||||
end
|
||||
|
||||
function throwing.make_arrow_def(def)
|
||||
def.timer = 0
|
||||
def.player = ""
|
||||
def.on_step = arrow_step
|
||||
def.data = {}
|
||||
return def
|
||||
end
|
||||
|
||||
--[[
|
||||
on_hit(pos, last_pos, node, object, hitter)
|
||||
Either node or object is nil, depending whether the arrow collided with an object (luaentity or player) or with a node.
|
||||
|
|
Loading…
Reference in New Issue
Block a user