Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: correct calcposition call at party logic #3923

Merged
merged 2 commits into from
Dec 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading