Skip to content

Commit c892d09

Browse files
committed
Change site option to target all written works in site
1 parent adb224e commit c892d09

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

docs/fix/codex-pages.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Options
2424
Add pages to the selected codex, quire, or scroll item.
2525

2626
``site``
27-
Add pages to all written works that were authored in the player's fortress.
27+
Add pages to all written works that are currently in the player's fortress.
2828

2929
``all``
3030
Add pages to all written works to have ever existed in the world.

fix/codex-pages.lua

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,12 @@ local function GetBooks(target)
2020
local item = dfhack.gui.getSelectedItem(true)
2121
if item and isBook(item) then table.insert(books, item) end
2222
elseif target.site then
23-
-- Does not include written content not created in player's fortress.
24-
local siteArtifacts = df.global.world.items.other.ANY_ARTIFACT
25-
for _, item in ipairs(siteArtifacts) do
23+
local siteTools = df.global.world.items.other.TOOL
24+
for _, item in ipairs(siteTools) do
25+
if isBook(item) then table.insert(books, item) end
26+
end
27+
local siteBooks = df.global.world.items.other.BOOK
28+
for _, item in ipairs(siteBooks) do
2629
if isBook(item) then table.insert(books, item) end
2730
end
2831
end

0 commit comments

Comments
 (0)