From 01247488e81b7b0476fec71b1d350fa95b3704ad Mon Sep 17 00:00:00 2001 From: hexhexD Date: Sun, 11 Feb 2024 21:55:44 -0800 Subject: [PATCH] Fix the bug where both moving from and to coordinates are the same when 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. --- src/Network/Receive/ServerType0.pm | 4 ++-- src/Network/Receive/kRO/Sakexe_0.pm | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Network/Receive/ServerType0.pm b/src/Network/Receive/ServerType0.pm index cc49fd2947..7bee39e141 100644 --- a/src/Network/Receive/ServerType0.pm +++ b/src/Network/Receive/ServerType0.pm @@ -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; } diff --git a/src/Network/Receive/kRO/Sakexe_0.pm b/src/Network/Receive/kRO/Sakexe_0.pm index 57848f5aec..597199cee1 100644 --- a/src/Network/Receive/kRO/Sakexe_0.pm +++ b/src/Network/Receive/kRO/Sakexe_0.pm @@ -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; }