Small bug fixes and log cleanups.
This commit is contained in:
parent
4ec8ad7f7f
commit
337f8c46b7
@ -325,7 +325,7 @@ function npc.dialogue.select_random_dialogues_for_npc(self, phase)
|
|||||||
for i = 1, number_of_dialogues do
|
for i = 1, number_of_dialogues do
|
||||||
local key_id = math.random(1, #keys)
|
local key_id = math.random(1, #keys)
|
||||||
result.normal[i] = keys[key_id]
|
result.normal[i] = keys[key_id]
|
||||||
minetest.log("Adding dialogue: "..dump(dialogues[keys[key_id]]))
|
npc.log("DEBUG", "Adding dialogue: "..dump(dialogues[keys[key_id]]))
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Add item hints.
|
-- Add item hints.
|
||||||
|
@ -209,7 +209,7 @@ function npc.relationships.get_dialogues_for_gift_item(item_name, dialogue_type,
|
|||||||
if phase ~= nil then
|
if phase ~= nil then
|
||||||
tags[5] = phase
|
tags[5] = phase
|
||||||
end
|
end
|
||||||
minetest.log("Searching with tags: "..dump(tags))
|
npc.log("DEBUG","Searching with tags: "..dump(tags))
|
||||||
|
|
||||||
return npc.dialogue.search_dialogue_by_tags(tags, true)
|
return npc.dialogue.search_dialogue_by_tags(tags, true)
|
||||||
end
|
end
|
||||||
|
10
utils.lua
10
utils.lua
@ -30,12 +30,20 @@ end
|
|||||||
|
|
||||||
function npc.utils.get_map_keys(map)
|
function npc.utils.get_map_keys(map)
|
||||||
local result = {}
|
local result = {}
|
||||||
for key, value in pairs(map) do
|
for key, _ in pairs(map) do
|
||||||
table.insert(result, key)
|
table.insert(result, key)
|
||||||
end
|
end
|
||||||
return result
|
return result
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function npc.utils.get_map_values(map)
|
||||||
|
local result = {}
|
||||||
|
for _, value in pairs(map) do
|
||||||
|
table.insert(result, value)
|
||||||
|
end
|
||||||
|
return result
|
||||||
|
end
|
||||||
|
|
||||||
-- This function searches for a node given the conditions specified in the
|
-- This function searches for a node given the conditions specified in the
|
||||||
-- query object, starting from the given start_pos and up to a certain, specified
|
-- query object, starting from the given start_pos and up to a certain, specified
|
||||||
-- range.
|
-- range.
|
||||||
|
Loading…
Reference in New Issue
Block a user