eye_height no longer hardcoded
This commit is contained in:
parent
ca0f11b586
commit
d857dd136b
5
init.lua
5
init.lua
@ -182,8 +182,9 @@ function bow2.shoot(itemstack, user, pointed_thing)
|
||||
itemstack:set_name(bow_name)
|
||||
|
||||
local pos = user:get_pos()
|
||||
pos.y = pos.y + user:get_properties().eye_height
|
||||
local dir = user:get_look_dir()
|
||||
local obj = core.add_entity({x = pos.x, y = pos.y + 1.5, z = pos.z}, 'bow2:arrow_entity', core.serialize(staticdata))
|
||||
local obj = core.add_entity(pos, 'bow2:arrow_entity', core.serialize(staticdata))
|
||||
|
||||
if not obj then
|
||||
return itemstack
|
||||
@ -208,7 +209,7 @@ function bow2.shoot(itemstack, user, pointed_thing)
|
||||
|
||||
core.sound_play(sound_name, {
|
||||
gain = 0.3,
|
||||
pos = user:get_pos(),
|
||||
pos = pos,
|
||||
max_hear_distance = 10
|
||||
})
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user