Skip to content

Commit ad1e31f

Browse files
committed
use find methods instead of array indexing
because the vector indices are not guaranteed to be the same as the ids (though it appears that they usually are)
1 parent 46a9676 commit ad1e31f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

necronomicon.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function get_book_interactions(item)
1414

1515
for _, ref in ipairs (written_content.refs) do
1616
if ref._type == df.general_ref_interactionst then
17-
local interaction = df.global.world.raws.interactions[ref.interaction_id]
17+
local interaction = df.interaction.find(ref.interaction_id)
1818
table.insert(book_interactions, interaction)
1919
end
2020
end
@@ -34,7 +34,7 @@ end
3434
function get_item_artifact(item)
3535
for _, ref in ipairs(item.general_refs) do
3636
if ref._type == df.general_ref_is_artifactst then
37-
return df.global.world.artifacts.all[ref.artifact_id]
37+
return df.artifact_record.find(ref.artifact_id)
3838
end
3939
end
4040
end

0 commit comments

Comments
 (0)