tried to reset AIWander, didn't work but reset is true by default, so it stays
This commit is contained in:
parent
f709b409fd
commit
ef781be4b3
1 changed files with 7 additions and 5 deletions
|
@ -50,12 +50,13 @@ local function stopFollowing(onTimer)
|
||||||
if not follower or not isFollowing then return end
|
if not follower or not isFollowing then return end
|
||||||
isFollowing = false
|
isFollowing = false
|
||||||
|
|
||||||
|
local function startWander()
|
||||||
local wanderRange = common.generateWanderRange(tes3.getPlayerCell())
|
local wanderRange = common.generateWanderRange(tes3.getPlayerCell())
|
||||||
local idles = common.generateIdles()
|
local idles = common.generateIdles()
|
||||||
|
|
||||||
local function startWander()
|
log("%s has probably reached their original destination, resuming %s range wander...", follower.object.name,
|
||||||
log("%s has probably reached their original destination, resuming wander...", follower.object.name)
|
wanderRange)
|
||||||
tes3.setAIWander({reference = follower, range = wanderRange, reset = false, idles = idles})
|
tes3.setAIWander({reference = follower, range = wanderRange, reset = true, idles = idles})
|
||||||
|
|
||||||
follower = nil
|
follower = nil
|
||||||
end
|
end
|
||||||
|
@ -135,6 +136,7 @@ end
|
||||||
|
|
||||||
this.onDetectSneak = function(e)
|
this.onDetectSneak = function(e)
|
||||||
if not config.sneakEnable then return end
|
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 e.target ~= tes3.mobilePlayer or not tes3.mobilePlayer.isSneaking or not e.detector.object.isGuard then return end
|
||||||
|
|
||||||
if not isFollowing then
|
if not isFollowing then
|
||||||
|
|
Loading…
Add table
Reference in a new issue