Otherwise the functionality is as before.
Attached is a new version of classes/waypointlist_wander.lua
Best regard
Iyfgf
Update:
Turns out player wanders way off due to targeting, to keep it within wander radius I've added a check in the default target evaluation function in class/player.lua, function evalTargetDefault, before the MAX_TARGET_DIST check:
Code: Select all
-- New, check if target is within wander radius
if( __WPL.Mode == "wander" and distance(__WPL.OrigX, __WPL.OrigZ, target.X, target.Z) > __WPL.Radius ) then
debug_target("target not within wander radius")
return false;
end
-- check distance to target against MAX_TARGET_DIST
if( distance(player.X, player.Z, target.X, target.Z) > settings.profile.options.MAX_TARGET_DIST ) then
debug_target("target dist > MAX_TARGET_DIST to player")
return false; -- he is not a valid target
end;