Skip to content

Commit

Permalink
fix: correct calcPosition call at party logic (#3923)
Browse files Browse the repository at this point in the history
  • Loading branch information
alisonrag authored Dec 28, 2024
1 parent bc74f0f commit 97f1657
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/AI/CoreLogic.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2889,7 +2889,7 @@ sub processAutoSkillUse {
##### PARTY-SKILL USE #####
sub processPartySkillUse {
if (AI::isIdle || AI::is(qw(route mapRoute follow sitAuto take items_gather items_take attack move))){
my $realMyPos = calcPosition($field, $char);
my $realMyPos = calcPosition($char);
my %party_skill;
PARTYSKILL:
for (my $i = 0; exists $config{"partySkill_$i"}; $i++) {
Expand Down Expand Up @@ -2923,7 +2923,7 @@ sub processPartySkillUse {
);
my $party_skill_dist = $config{"partySkill_$i"."_dist"} || $config{partySkillDistance} || "0..8";
if (defined($config{"partySkill_$i"."_dist"}) && defined($config{"partySkill_$i"."_maxDist"})) { $party_skill_dist = $config{"partySkill_$i"."_dist"} . ".." . $config{"partySkill_$i"."_maxDist"};}
my $realActorPos = calcPosition($field, $player);
my $realActorPos = calcPosition($player);
my $distance = blockDistance($realMyPos, $realActorPos);
next unless ($party_skill{owner}{ID} eq $player->{ID} || inRange($distance, $party_skill_dist));
next unless (checkPlayerCondition("partySkill_$i"."_target", $ID));
Expand Down
13 changes: 6 additions & 7 deletions src/Network/XKore2.pm
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ package Network::XKore2;

use strict;
use Globals qw(%config %rpackets $masterServer $char);
use Utils qw(makeCoordsDir makeCoordsXY makeCoordsFromTo calcPosition);
use Utils::Exceptions;
use Plugins;
use Base::Ragnarok::SessionStore;
Expand Down Expand Up @@ -101,35 +100,35 @@ sub sync_request_ex {

sub map_loaded {
my (undef, $args) = @_;

$args->{mangle} = 2;
}

sub map_changed {
my (undef, $args) = @_;

$mapServerChange = Storable::dclone($args);

$args->{mangle} = 2;
}

sub initialize_message_id_encryption {
my (undef, $args) = @_;

$args->{mangle} = 2;
}

sub stateChanged {
$accountServer->setServerType($masterServer->{serverType});
$charServer->setServerType($masterServer->{serverType});
$mapServer->setServerType($masterServer->{serverType});

if ($Globals::net->getState() == Network::IN_GAME && $mapServerChange ne '') {
$Globals::net->clientSend($mapServer->{recvPacketParser}->reconstruct({
%$mapServerChange,
switch => 'map_change',
}));

$mapServerChange = undef;
}
}
Expand Down

0 comments on commit 97f1657

Please sign in to comment.