Skip to content

Commit

Permalink
Added helper functions for getting group assist targets to ressolve c…
Browse files Browse the repository at this point in the history
…rashes
  • Loading branch information
DerpleMQ2 committed Jan 1, 2024
1 parent 0ac6287 commit 0af6cec
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
5 changes: 3 additions & 2 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,9 @@ local function RGInit(...)
RGMercsLogger.log_info("\aw Assisting \ay >> \ag %s \ay << \aw at \ag %d%%", RGMercConfig.Globals.MainAssist, RGMercConfig:GetSettings().AutoAssistAt)
end

if mq.TLO.Group.MainAssist.CleanName() ~= mainAssist then
RGMercUtils.PopUp(string.format("Assisting %s NOTICE: Group MainAssist != Your Target. Is This On Purpose?", mainAssist))
if RGMercUtils.GetGroupMainAssistName() ~= mainAssist then
RGMercUtils.PopUp(string.format("Assisting: %s NOTICE: Group MainAssist [%s] != Your Assist Target [%s]. Is This On Purpose?", mainAssist,
RGMercUtils.GetGroupMainAssistName(), mainAssist))
end
end

Expand Down
12 changes: 10 additions & 2 deletions utils/rgmercs_utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,14 @@ function Utils.GetTargetID()
return (mq.TLO.Target.ID() or 0)
end

function Utils.GetGroupMainAssistID()
return (mq.TLO.Group.MainAssist.ID() or 0)
end

function Utils.GetGroupMainAssistName()
return (mq.TLO.Group.MainAssist.CleanName() or "")
end

function Utils.BurnCheck(config)
return ((config.BurnAuto and (Utils.GetXTHaterCount() >= config.BurnMobCount or (mq.TLO.Target.Named() and config.BurnNamed) or (config.BurnAlways and config.BurnAuto))) or (not config.BurnAuto and config.BurnSize))
end
Expand Down Expand Up @@ -1253,8 +1261,8 @@ function Utils.SetControlToon()
end
end

if RGMercConfig:GetAssistId() ~= mq.TLO.Group.MainAssist.ID() and mq.TLO.Group.MainAssist.ID() > 0 then
RGMercConfig.Globals.MainAssist = mq.TLO.Group.MainAssist.CleanName()
if RGMercConfig:GetAssistId() ~= Utils.GetGroupMainAssistID() and Utils.GetGroupMainAssistID() > 0 then
RGMercConfig.Globals.MainAssist = Utils.GetGroupMainAssistName()
end
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 = '4bdc50a (Added Config Categories Added code to remove deprecated config options from user config files, 2023-12-31)' }
return { commitId = '0ac6287 (linting fixes, 2023-12-31)' }

0 comments on commit 0af6cec

Please sign in to comment.