From 19b42000a056c6febf22c610d972a8f49713a60a Mon Sep 17 00:00:00 2001 From: HungDK <> Date: Wed, 5 Nov 2025 16:37:32 +0700 Subject: [PATCH 1/3] Fix error update player distance to object --- Assets/PerfectWorld/Scripts/NPC/CECNPC.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Assets/PerfectWorld/Scripts/NPC/CECNPC.cs b/Assets/PerfectWorld/Scripts/NPC/CECNPC.cs index cb805e4e3e..fef5a76a26 100644 --- a/Assets/PerfectWorld/Scripts/NPC/CECNPC.cs +++ b/Assets/PerfectWorld/Scripts/NPC/CECNPC.cs @@ -418,6 +418,14 @@ public class CECNPC : CECObject { case (int)WorkID.WORK_MOVE: TickWork_Move(Time.deltaTime); break; } + + // Calculate distance to host player + CECHostPlayer pHost = EC_ManMessageMono.Instance.EC_ManPlayer.GetHostPlayer(); + if (pHost /*&& pHost.IsSkeletonReady()*/) + { + m_fDistToHost = CalcDist(pHost.GetPos(), true); + m_fDistToHostH = CalcDist(pHost.GetPos(), false); + } if (IsDisappearing()) { From 691b27b69fff89d95d8e70b5a38a92bdad24ebf4 Mon Sep 17 00:00:00 2001 From: HungDK <> Date: Wed, 5 Nov 2025 16:38:23 +0700 Subject: [PATCH 2/3] Fix duplicate init else player, duplicate model --- .../Scripts/Managers/EC_ManPlayer.cs | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_ManPlayer.cs b/Assets/PerfectWorld/Scripts/Managers/EC_ManPlayer.cs index b54a27334c..57968fd509 100644 --- a/Assets/PerfectWorld/Scripts/Managers/EC_ManPlayer.cs +++ b/Assets/PerfectWorld/Scripts/Managers/EC_ManPlayer.cs @@ -312,12 +312,23 @@ namespace PerfectWorld.Scripts.Managers // Has player been in active player table ? EC_ElsePlayer pPlayer = GetElsePlayer(info.cid); - if (pPlayer) + if (pPlayer != null) { - // This player has existed in player table, call special initial function - // TODO: fix after pPlayer init - pPlayer.Init(roleInfo, info); - return pPlayer; + // Check if the GameObject is still valid (not destroyed) + if (pPlayer.gameObject != null) + { + // This player has existed in player table, call special initial function + pPlayer.Init(roleInfo, info); + return pPlayer; + } + else + { + // GameObject was destroyed but entry still exists in table - clean it up + lock (m_csPlayerTab) + { + m_PlayerTab.Remove(info.cid); + } + } } // Create a new player From 0798b25db3ef4c0b6d6a55e2f76c7460b9189da2 Mon Sep 17 00:00:00 2001 From: HungDK <> Date: Wed, 5 Nov 2025 16:45:56 +0700 Subject: [PATCH 3/3] Update a61.unity --- Assets/Scenes/a61.unity | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Assets/Scenes/a61.unity b/Assets/Scenes/a61.unity index 930afe5fc2..5bb4f357fe 100644 --- a/Assets/Scenes/a61.unity +++ b/Assets/Scenes/a61.unity @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a796566213f473ba41f62ea095ffc77a600b914cc9618039db355559ebbbc1b0 -size 533673935 +oid sha256:be46a3da24b5ac14ebe37a3949ecd93e282be9f5b87be79549a2af454134588f +size 533707718