Skip to content

Commit

Permalink
- Fix for hunt pull mode not working right.
Browse files Browse the repository at this point in the history
  • Loading branch information
DerpleMQ2 committed Feb 19, 2024
1 parent 8018e6d commit df86254
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
16 changes: 12 additions & 4 deletions modules/pull.lua
Original file line number Diff line number Diff line change
Expand Up @@ -753,10 +753,18 @@ function Module:CheckGroupForPull(classes, resourceStartPct, resourceStopPct, ca
end

--if (member.Distance() or 0) > math.max(RGMercConfig.SubModuleSettings.Movement.settings.AutoCampRadius, 80) then
if RGMercUtils.GetDistance(member.X(), member.Y(), campData.AutoCampX, campData.AutoCampY) > math.max(RGMercConfig.SubModuleSettings.Movement.settings.AutoCampRadius, 50) then
RGMercUtils.PrintGroupMessage("%s is too far away - Holding pulls!", member.CleanName())
return false,
string.format("%s Too Far (%d)", member.CleanName(), RGMercUtils.GetDistance(member.X(), member.Y(), campData.AutoCampX, campData.AutoCampY))
if returnToCamp then
if RGMercUtils.GetDistance(member.X(), member.Y(), campData.AutoCampX, campData.AutoCampY) > math.max(RGMercConfig.SubModuleSettings.Movement.settings.AutoCampRadius, 50) then
RGMercUtils.PrintGroupMessage("%s is too far away - Holding pulls!", member.CleanName())
return false,
string.format("%s Too Far (%d)", member.CleanName(), RGMercUtils.GetDistance(member.X(), member.Y(), campData.AutoCampX, campData.AutoCampY))
end
else
if (member.Distance() or 0) > math.max(RGMercConfig.SubModuleSettings.Movement.settings.AutoCampRadius, 80) then
RGMercUtils.PrintGroupMessage("%s is too far away - Holding pulls!", member.CleanName())
return false,
string.format("%s Too Far (%d)", member.CleanName(), RGMercUtils.GetDistance(member.X(), member.Y(), campData.AutoCampX, campData.AutoCampY))
end
end

if self.Constants.PullModes[self.settings.PullMode] == "Chain" then
Expand Down
8 changes: 7 additions & 1 deletion utils/rgmercs_utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1446,6 +1446,12 @@ function Utils.GetTargetPctHPs(target)
return (target and target.PctHPs() or (mq.TLO.Target.PctHPs() or 0))
end

---@param target MQTarget|nil
---@return boolean
function Utils.GetTargetDead(target)
return (target and target.Dead() or (mq.TLO.Target.Dead() or true))
end

---@param target MQTarget|nil
---@return string
function Utils.GetTargetName(target)
Expand Down Expand Up @@ -1987,7 +1993,7 @@ function Utils.EngageTarget(autoTargetId, preEngageRoutine)
mq.TLO.Me.Stand()
end

if (Utils.GetTargetPctHPs() <= config.AutoAssistAt or Utils.IAmMA()) and Utils.GetTargetPctHPs() > 0 then
if (Utils.GetTargetPctHPs() <= config.AutoAssistAt or Utils.IAmMA()) and not Utils.GetTargetDead() then
if target.Distance() > Utils.GetTargetMaxRangeTo(target) then
RGMercsLogger.log_debug("Target is too far! %d>%d attempting to nav to it.", target.Distance(),
target.MaxRangeTo())
Expand Down

0 comments on commit df86254

Please sign in to comment.