Skip to content

Commit f15dd35

Browse files
authored
Merge pull request #1307 from myk002/myk_necro
[necronomicon] use find methods instead of array indexing
2 parents 46a9676 + 0602cbb commit f15dd35

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

necronomicon.lua

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
-- lists books that contain secrets of life and death.
2-
-- Author: Ajhaa
32

43
local argparse = require("argparse")
54

@@ -14,7 +13,7 @@ function get_book_interactions(item)
1413

1514
for _, ref in ipairs (written_content.refs) do
1615
if ref._type == df.general_ref_interactionst then
17-
local interaction = df.global.world.raws.interactions[ref.interaction_id]
16+
local interaction = df.interaction.find(ref.interaction_id)
1817
table.insert(book_interactions, interaction)
1918
end
2019
end
@@ -34,7 +33,7 @@ end
3433
function get_item_artifact(item)
3534
for _, ref in ipairs(item.general_refs) do
3635
if ref._type == df.general_ref_is_artifactst then
37-
return df.global.world.artifacts.all[ref.artifact_id]
36+
return df.artifact_record.find(ref.artifact_id)
3837
end
3938
end
4039
end

0 commit comments

Comments
 (0)