From ef781be4b39677af4aa0fae5c089fe467d93d3d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lilian=20J=C3=B3nsd=C3=B3ttir?= Date: Tue, 28 Jul 2020 23:04:59 -0700 Subject: [PATCH] tried to reset AIWander, didn't work but reset is true by default, so it stays --- MWSE/mods/celediel/MoreAttentiveGuards/sneak.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/MWSE/mods/celediel/MoreAttentiveGuards/sneak.lua b/MWSE/mods/celediel/MoreAttentiveGuards/sneak.lua index 3b353e3..a07406b 100644 --- a/MWSE/mods/celediel/MoreAttentiveGuards/sneak.lua +++ b/MWSE/mods/celediel/MoreAttentiveGuards/sneak.lua @@ -50,12 +50,13 @@ local function stopFollowing(onTimer) if not follower or not isFollowing then return end isFollowing = false - local wanderRange = common.generateWanderRange(tes3.getPlayerCell()) - local idles = common.generateIdles() - local function startWander() - log("%s has probably reached their original destination, resuming wander...", follower.object.name) - tes3.setAIWander({reference = follower, range = wanderRange, reset = false, idles = idles}) + local wanderRange = common.generateWanderRange(tes3.getPlayerCell()) + local idles = common.generateIdles() + + log("%s has probably reached their original destination, resuming %s range wander...", follower.object.name, + wanderRange) + tes3.setAIWander({reference = follower, range = wanderRange, reset = true, idles = idles}) follower = nil end @@ -135,6 +136,7 @@ end this.onDetectSneak = function(e) if not config.sneakEnable then return end + if e.target ~= tes3.mobilePlayer or not tes3.mobilePlayer.isSneaking or not e.detector.object.isGuard then return end if not isFollowing then