Skip to content

Commit

Permalink
Function decorations for utils.
Browse files Browse the repository at this point in the history
  • Loading branch information
DerpleMQ2 committed Jan 3, 2024
1 parent f30b8be commit e2cb633
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions utils/rgmercs_utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ function Utils.UseSpell(spellName, targetId, bAllowMem)

-- Check for Reagents
if not Utils.ReagentCheck(spell) then
RGMercsLogger.log_error("\arTRAGIC ERROR: Somehow I tried to cast a spell I didn't know: %s", spellName)
RGMercsLogger.log_verbose("\arTRAGIC ERROR: I tried to cast a spell spell I don't have Reagents for.", spellName)
return false
end

Expand Down Expand Up @@ -1548,11 +1548,13 @@ end
function Utils.ReagentCheck(spell)
if not spell or not spell() then return false end

if spell.ReagentID(1)() and mq.TLO.FindItemCount(spell.ReagentID(1)())() == 0 then
if spell.ReagentID(1)() > 0 and mq.TLO.FindItemCount(spell.ReagentID(1)())() == 0 then
RGMercsLogger.log_verbose("Missing Reagent: (%d)", spell.ReagentID(1)())
return false
end

if spell.NoExpendReagentID(1)() and mq.TLO.FindItemCount(spell.NoExpendReagentID(1)())() == 0 then
if spell.NoExpendReagentID(1)() > 0 and mq.TLO.FindItemCount(spell.NoExpendReagentID(1)())() == 0 then
RGMercsLogger.log_verbose("Missing NoExpendReagent: (%d)", spell.NoExpendReagentID(1)())
return false
end

Expand Down
2 changes: 1 addition & 1 deletion version.lua
Original file line number Diff line number Diff line change
@@ -1 +1 @@
return { commitId = 'a2f317d 2024-01-02' }
return { commitId = 'f30b8be 2024-01-02' }

0 comments on commit e2cb633

Please sign in to comment.