Skip to content

Commit

Permalink
Fix the bug where both moving from and to coordinates are the same wh…
Browse files Browse the repository at this point in the history
…en moving between differnt cells.

$char->{pos} and $char->{pos_to} are both a reference to a hash of
coordinates. They were incorrectly assigned to the same reference inside
skill_used_no_damage() which made them pointing to the same hash. There will
be no more strange routing after this fix.

This has been bothering me for a long time now. I'm happy I finally got
to the bootm of it.
  • Loading branch information
hexhexD committed Feb 12, 2024
1 parent 3fbb592 commit 0124748
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Network/Receive/ServerType0.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1389,8 +1389,8 @@ sub skill_used_no_damage {
countCastOn($args->{sourceID}, $args->{targetID}, $args->{skillID});
if ($args->{sourceID} eq $accountID) {
my $pos = calcPosition($char);
$char->{pos} = $pos;
$char->{pos_to} = $pos;
%{$char->{pos}} = %{$pos};
%{$char->{pos_to}} = %{$pos};
$char->{time_move} = 0;
$char->{time_move_calc} = 0;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Network/Receive/kRO/Sakexe_0.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1367,8 +1367,8 @@ sub skill_used_no_damage {
countCastOn($args->{sourceID}, $args->{targetID}, $args->{skillID});
if ($args->{sourceID} eq $accountID) {
my $pos = calcPosition($char);
$char->{pos} = $pos;
$char->{pos_to} = $pos;
%{$char->{pos}} = %{$pos};
%{$char->{pos_to}} = %{$pos};
$char->{time_move} = 0;
$char->{time_move_calc} = 0;
}
Expand Down

0 comments on commit 0124748

Please sign in to comment.