Skip to content

Commit b4a5240

Browse files
tjurczykTomasz Jurczyk
and
Tomasz Jurczyk
authored
Knowledge fixes (#1565)
Co-authored-by: Tomasz Jurczyk <[email protected]>
1 parent 6933a9a commit b4a5240

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

skrypty/misc/knowledge/books.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ function scripts.misc.knowledge:show_book_stats(full)
137137

138138
table.insert(books_per_category[row.about],
139139
{ ["book"] = row.book, ["progress"] = row.progress })
140-
books_started_reading[row.book] = true
140+
books_started_reading[row.book .. row.about] = true
141141
end
142142

143143
for _, category in pairs(misc.knowledge.categories) do
@@ -149,7 +149,7 @@ function scripts.misc.knowledge:show_book_stats(full)
149149
if full == true then
150150
for category, books in pairs(scripts.misc.knowledge.category_to_books) do
151151
for book, _ in pairs(books) do
152-
if books_started_reading[book] == nil then
152+
if books_started_reading[book .. category] == nil then
153153
table.insert(books_per_category[category],
154154
{ ["book"] = book, ["progress"] = 0 })
155155
end

skrypty/misc/knowledge/libraries.lua

+2-3
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ function scripts.misc.knowledge:show_library_stats(full)
7575
local libraries_read = db:fetch(scripts.misc.knowledge.db.library_progress,
7676
{ db:eq(scripts.misc.knowledge.db.library_progress.character, scripts.character_name) })
7777

78-
display(libraries_read)
7978
local libraries_per_category = {}
8079
local libraries_started_reading = {}
8180
for _, row in pairs(libraries_read) do
@@ -85,7 +84,7 @@ function scripts.misc.knowledge:show_library_stats(full)
8584

8685
table.insert(libraries_per_category[row.about],
8786
{ ["library"] = row.library, ["progress"] = row.progress })
88-
libraries_started_reading[row.library] = true
87+
libraries_started_reading[row.library .. row.about] = true
8988
end
9089

9190
for _, category in pairs(misc.knowledge.categories) do
@@ -97,7 +96,7 @@ function scripts.misc.knowledge:show_library_stats(full)
9796
if full == true then
9897
for category, libraries in pairs(scripts.misc.knowledge.category_to_libraries) do
9998
for library, _ in pairs(libraries) do
100-
if libraries_started_reading[library] == nil then
99+
if libraries_started_reading[library .. category] == nil then
101100
table.insert(libraries_per_category[category],
102101
{ ["library"] = library, ["progress"] = 0 })
103102
end

0 commit comments

Comments
 (0)