Merge branch 'feature/revive' into develop

This commit is contained in:
HungDK
2025-11-05 16:51:30 +07:00
3 changed files with 26 additions and 7 deletions
@@ -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
@@ -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())
{
+2 -2
View File
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a796566213f473ba41f62ea095ffc77a600b914cc9618039db355559ebbbc1b0
size 533673935
oid sha256:be46a3da24b5ac14ebe37a3949ecd93e282be9f5b87be79549a2af454134588f
size 533707718