forked from VoxeLibre/VoxeLibre
add a small bit of doc
This commit is contained in:
parent
78940e109c
commit
6c804f44d5
|
@ -198,9 +198,11 @@ function ARROW_ENTITY.on_step(self, dtime)
|
||||||
end
|
end
|
||||||
|
|
||||||
local arrow_dir = self.object:get_velocity()
|
local arrow_dir = self.object:get_velocity()
|
||||||
|
--create a raycast from the arrow based on the velocity of the arrow to deal with lag
|
||||||
local raycast = minetest.raycast(pos, vector.add(pos, vector.multiply(arrow_dir, 0.1)), true, false)
|
local raycast = minetest.raycast(pos, vector.add(pos, vector.multiply(arrow_dir, 0.1)), true, false)
|
||||||
for hitpoint in raycast do
|
for hitpoint in raycast do
|
||||||
if hitpoint.type == "object" then
|
if hitpoint.type == "object" then
|
||||||
|
-- find the closest object that is in the way of the arrow
|
||||||
local ok = false
|
local ok = false
|
||||||
if hitpoint.ref:is_player() then
|
if hitpoint.ref:is_player() then
|
||||||
ok = true
|
ok = true
|
||||||
|
|
Reference in New Issue