here's the part of code in question:
Code: Select all
...
} elsif ($players_old{$args->{'ID'}}{'disappeared'}) {
message T("Trying to find lost master\n"), "follow", 1;
delete $args->{'ai_follow_lost_char_last_pos'};
delete $args->{'follow_lost_portal_tried'};
$args->{'ai_follow_lost'} = 1;
$args->{'ai_follow_lost_end'}{'timeout'} = $timeout{'ai_follow_lost_end'}{'timeout'};
$args->{'ai_follow_lost_end'}{'time'} = time;
$args->{'ai_follow_lost_vec'} = {};
getVector($args->{'ai_follow_lost_vec'}, $players_old{$args->{'ID'}}{'pos_to'}, $chars[$config{'char'}]{'pos_to'});
#check if player went through portal
my $first = 1;
my $foundID;
my $smallDist;
foreach (@portalsID) {
next if (!defined $_);
$ai_v{'temp'}{'dist'} = distance($players_old{$args->{'ID'}}{'pos_to'}, $portals{$_}{'pos'});
if ($ai_v{'temp'}{'dist'} <= 7 && ($first || $ai_v{'temp'}{'dist'} < $smallDist)) {
$smallDist = $ai_v{'temp'}{'dist'};
$foundID = $_;
undef $first;
}
}
$args->{'follow_lost_portalID'} = $foundID;
} else {
...
so, finally, the question/help request is: could anyone be so generous and kind to provide me modified condition check that could replace this one:
Code: Select all
...
} elsif ($players_old{$args->{'ID'}}{'disappeared'}) {
...
thanks in advance to anyone that may bother.