Skip to content

Commit

Permalink
Merge pull request #1307 from myk002/myk_necro
Browse files Browse the repository at this point in the history
[necronomicon] use find methods instead of array indexing
  • Loading branch information
myk002 authored Sep 17, 2024
2 parents 46a9676 + 0602cbb commit f15dd35
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions necronomicon.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
-- lists books that contain secrets of life and death.
-- Author: Ajhaa

local argparse = require("argparse")

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

for _, ref in ipairs (written_content.refs) do
if ref._type == df.general_ref_interactionst then
local interaction = df.global.world.raws.interactions[ref.interaction_id]
local interaction = df.interaction.find(ref.interaction_id)
table.insert(book_interactions, interaction)
end
end
Expand All @@ -34,7 +33,7 @@ end
function get_item_artifact(item)
for _, ref in ipairs(item.general_refs) do
if ref._type == df.general_ref_is_artifactst then
return df.global.world.artifacts.all[ref.artifact_id]
return df.artifact_record.find(ref.artifact_id)
end
end
end
Expand Down

0 comments on commit f15dd35

Please sign in to comment.