Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
brightrim committed Nov 28, 2024
1 parent dbfaecb commit ddc74a2
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions magic/arcane/enchanting/core/combine_shards_into_glyph.lua
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,22 @@ end

local function passesChecks(user, wand)

if not wand then
local leftTool = user:getItemAt(Character.left_tool)
local rightTool = user:getItemAt(Character.right_tool)
if common.isInList(leftTool.id, magic.wandIds) then
wand = leftTool
elseif common.isInList(rightTool.id, magic.wandIds) then
wand = rightTool
end
end

local isMage = user:getMagicType() == 0 and (user:getQuestProgress(37) ~= 0 or user:getMagicFlags(0) > 0)
local wandInHand = common.IsItemInHands(wand)
local wandInHand = false

if wand then
wandInHand = common.IsItemInHands(wand)
end

if not isMage then
return false --should never even reach this point but just in case
Expand Down Expand Up @@ -284,7 +298,7 @@ function M.start(user, wand)
local craftingTime = getCraftingTime(skill, glyph)
local foodOk = checkRequiredFood(user, craftingTime)
local manaOk = checkRequiredMana(user, craftingTime)
local canWork = passesChecks(user, wand) and hasMaterials(user, shards) and foodOk and manaOk
local canWork = passesChecks(user) and hasMaterials(user, shards) and foodOk and manaOk

return canWork

Expand Down

0 comments on commit ddc74a2

Please sign in to comment.