Use dot notation for api methods, closes #18

This commit is contained in:
stujones11 2019-03-16 19:33:08 +00:00
parent cff296d70b
commit e415b0b9cc
6 changed files with 27 additions and 27 deletions

View file

@ -58,12 +58,12 @@ local function strike(arrow, pointed_thing, name)
local dir = vector.normalize(object:get_velocity())
if pointed_thing.type == "object" then
local target = pointed_thing.ref
if shooter:is_valid_object(target) then
if shooter.is_valid_object(target) then
local puncher = minetest.get_player_by_name(name)
if puncher and puncher ~= target then
local groups = target:get_armor_groups() or {}
if groups.fleshy then
shooter:spawn_particles(hit_pos,
shooter.spawn_particles(hit_pos,
shooter.config.explosion_texture)
end
target:punch(object, nil, arrow_tool_caps, dir)
@ -85,7 +85,7 @@ local function strike(arrow, pointed_thing, name)
hit_pos = vector.subtract(hit_pos, vector.multiply(dir, 0.25))
arrow.node_pos = pos
arrow.state = "stuck"
shooter:play_node_sound(node, pos)
shooter.play_node_sound(node, pos)
else
return
end