Skip to content

Commit

Permalink
Crash fix
Browse files Browse the repository at this point in the history
  • Loading branch information
DerpleMQ2 committed Jan 1, 2024
1 parent fc0fce1 commit 0a228ff
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ local script_actor = RGMercUtils.Actors.register(function(message)
if message()["from"] == RGMercConfig.Globals.CurLoadedChar then return end
if message()["script"] ~= RGMercUtils.ScriptName then return end

RGMercsLogger.log_error("\ayGot Event from(\am%s\ay) module(\at%s\ay) event(\at%s\ay)", message()["from"],
RGMercsLogger.log_info("\ayGot Event from(\am%s\ay) module(\at%s\ay) event(\at%s\ay)", message()["from"],
message()["module"],
message()["event"])

Expand Down
7 changes: 5 additions & 2 deletions modules/movement.lua
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,10 @@ function Module:GiveTime(combat_state)
RGMercUtils.AutoCampCheck(self.settings, self.TempSettings)
end

if not self:ShouldFollow() then return end
if not self:ShouldFollow() then
RGMercsLogger.log_verbose("ShouldFollow() check failed.")
return
end

if self.settings.ChaseOn and not self.settings.ChaseTarget then
self.settings.ChaseOn = false
Expand All @@ -296,7 +299,7 @@ function Module:GiveTime(combat_state)
end

if mq.TLO.Me.Dead() then return end
if chaseSpawn.Distance() < self.settings.ChaseDistance then return end
if not chaseSpawn() or chaseSpawn.Distance() < self.settings.ChaseDistance then return end

local Nav = mq.TLO.Nav

Expand Down
2 changes: 1 addition & 1 deletion utils/rgmercs_utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ end
function Utils.ShouldKillTargetReset()
local killSpawn = mq.TLO.Spawn(string.format("targetable id %d", RGMercConfig.Globals.AutoTargetID))
local killCorpse = mq.TLO.Spawn(string.format("corpse id %d", RGMercConfig.Globals.AutoTargetID))
return ((not killSpawn()) or killCorpse()) and RGMercConfig.Globals.AutoTargetID > 0
return ((not killSpawn() or killSpawn.Dead()) or killCorpse()) and RGMercConfig.Globals.AutoTargetID > 0
end

function Utils.AutoMed()
Expand Down

0 comments on commit 0a228ff

Please sign in to comment.