Skip to content

Commit

Permalink
Added AI subroutine clearExceptTimeouts, call it when auto teleporting
Browse files Browse the repository at this point in the history
  • Loading branch information
maikelvf committed Aug 16, 2024
1 parent 7d4e328 commit 82f9af1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions src/AI.pm
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,17 @@ sub clear {
}
}

sub clearExceptTimeouts {
undef @ai_seq;
undef @ai_seq_args;

foreach (keys %ai_v) {
if ($_ !~ /_time$/m) {
delete $ai_v{$_};
}
}
}

sub suspend {
my $i = (defined $_[0] ? $_[0] : 0);
$ai_seq_args[$i]{suspended} = time if $i < @ai_seq_args;
Expand Down
2 changes: 1 addition & 1 deletion src/Network/Receive.pm
Original file line number Diff line number Diff line change
Expand Up @@ -7215,7 +7215,7 @@ sub map_change {
}

if ($ai_v{temp}{clear_aiQueue}) {
AI::clear;
AI::clearExceptTimeouts;
AI::SlaveManager::clear();
}

Expand Down

0 comments on commit 82f9af1

Please sign in to comment.