Skip to content

Commit

Permalink
Merge pull request #2261 from OpenKore/fix_841
Browse files Browse the repository at this point in the history
Fix issue #841: After kill kore move away from another monsters
  • Loading branch information
lututui committed Aug 17, 2018
2 parents 9a1c103 + a5832d6 commit 3b3a01d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions src/AI/CoreLogic.pm
Expand Up @@ -626,7 +626,8 @@ sub processEscapeUnknownMaps {
ai_route($field->baseName, $randX, $randY,
maxRouteTime => $config{route_randomWalk_maxRouteTime},
attackOnRoute => 2,
noMapRoute => ($config{route_randomWalk} == 2 ? 1 : 0) );
noMapRoute => ($config{route_randomWalk} == 2 ? 1 : 0),
isRandomWalk => 1);
}
}
}
Expand Down Expand Up @@ -2154,7 +2155,8 @@ sub processRandomWalk {
ai_route($field->baseName, $randX, $randY,
maxRouteTime => $config{route_randomWalk_maxRouteTime},
attackOnRoute => 2,
noMapRoute => ($config{route_randomWalk} == 2 ? 1 : 0) );
noMapRoute => ($config{route_randomWalk} == 2 ? 1 : 0),
isRandomWalk => 1);
}
}
}
Expand Down Expand Up @@ -2975,6 +2977,9 @@ sub processAutoAttack {
# If an appropriate monster's found, attack it. If not, wait ai_attack_auto secs before searching again.
if ($attackTarget) {
ai_setSuspend(0);

AI::dequeue() while (AI::is(qw/move route mapRoute/) && AI::args()->{isRandomWalk});

$char->attack($attackTarget);
} else {
$timeout{'ai_attack_auto'}{'time'} = time;
Expand Down
2 changes: 1 addition & 1 deletion src/Actor.pm
Expand Up @@ -785,7 +785,7 @@ sub route {
} else {
$task = new Task::Route(@params);
}
$task->{$_} = $args{$_} for qw(attackID attackOnRoute noSitAuto LOSSubRoute);
$task->{$_} = $args{$_} for qw(attackID attackOnRoute noSitAuto LOSSubRoute isRandomWalk);

$self->queue('route', $task);
}
Expand Down

0 comments on commit 3b3a01d

Please sign in to comment.