Fix crash
This commit is contained in:
parent
2dc2400b38
commit
166db4b5e5
@ -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
|
||||
|
@ -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
|
||||
|
3
npc.lua
3
npc.lua
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user