Fix crash

This commit is contained in:
sys4-fr 2018-03-25 15:46:58 +02:00
parent 2dc2400b38
commit 166db4b5e5
3 changed files with 5 additions and 3 deletions

View File

@ -649,7 +649,7 @@ function npc.actions.use_openable(self, args)
local node = minetest.get_node(pos)
local state = npc.actions.get_openable_node_state(node, pos, dir)
local clicker = self.object
local clicker = self.object.npc_name
if action ~= state then
minetest.registered_nodes[node.name].on_rightclick(pos, node, clicker, nil, nil)
end
@ -1192,4 +1192,4 @@ function npc.actions.walk_to_pos(self, args)
self.object:moveto({x=end_pos.x, y=end_pos.y+1, z=end_pos.z})
end
end
end
end

View File

@ -259,6 +259,7 @@ function npc.places.find_unused_place(self, place_category, place_type, original
return alternative_places[i]
end
end
--result = original_place
else
result = original_place
end

View File

@ -1311,7 +1311,8 @@ function npc.after_activate(self)
if self.yaw_before_interaction then
self.object:setyaw(self.yaw_before_interaction)
end
else
else
if not self.actions then self.actions = {} end
-- Temporary code - adds the new state variables
self.actions.move_state = {
is_sitting = false,