Skip to content

Commit

Permalink
bugfix for previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
brightrim committed Feb 23, 2025
1 parent f5aef1f commit 4558a32
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion magic/arcane/arcaneMagicDesk.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ end
local function bookFound(user)

for _, book in pairs(grimoireCreation.books) do
if user:countItemAt("body",2619,{["magicBook"]="true"}) ~= 0 then
if user:countItemAt("body",book,{["magicBook"]="true"}) ~= 0 then
return true
end
end
Expand Down
12 changes: 7 additions & 5 deletions magic/arcane/createSpell.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,19 @@ local function getMagicBook(user)
local leftItem = user:getItemAt(5)
local rightItem = user:getItemAt(6)

for _, book in pairs(grimoireCreation.books) do
if leftItem:getData("magicBook") ~= "true" and rightItem:getData("magicBook") ~= "true" then --check for magic book data
return nil
end

for _, book in pairs(grimoireCreation.books) do --Check all valid book ids

if leftItem.id == book and leftItem:getData("magicBook") == "true" then
if leftItem.id == book then
return leftItem
elseif rightItem.id == book and leftItem:getData("magicBook") == "true" then
elseif rightItem.id == book then
return rightItem
end
end

debug("Error: We are now past the check for the grimoire but there is no grimoire.")

return nil

end
Expand Down

0 comments on commit 4558a32

Please sign in to comment.