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. (#3852)

$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 authored Feb 12, 2024
1 parent d075208 commit 1edc50f
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 1edc50f

Please sign in to comment.