diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_HPWorkMove.cs b/Assets/PerfectWorld/Scripts/Managers/EC_HPWorkMove.cs index 065bd0e96c..7672d2d72a 100644 --- a/Assets/PerfectWorld/Scripts/Managers/EC_HPWorkMove.cs +++ b/Assets/PerfectWorld/Scripts/Managers/EC_HPWorkMove.cs @@ -240,6 +240,12 @@ namespace BrewMonster.Scripts if (m_pHost.IsRooting()) return true; + if (m_pHost.IsDead()) + { + Finish(); + return true; + } + if (m_bUseAutoMoveDialog) { if (m_pHost.IsFlying()) diff --git a/Assets/Scripts/CECHostPlayer.Combat.cs b/Assets/Scripts/CECHostPlayer.Combat.cs index 9aea4076c4..03830871ed 100644 --- a/Assets/Scripts/CECHostPlayer.Combat.cs +++ b/Assets/Scripts/CECHostPlayer.Combat.cs @@ -876,11 +876,33 @@ namespace BrewMonster // Mark host player as corpse so CECPlayer.IsDead() returns true m_dwStates |= (uint)PlayerNPCState.GP_STATE_CORPSE; + // Mobile joystick keeps input while held; stop move work immediately (mirror HOST_NOTIFY_ROOT). + StopHostMovementOnDeath(); + EventBus.PublishChannel(GetCharacterID(), new ClearComActFlagAllRankNodesEvent(true)); PlayAction((int)PLAYER_ACTION_TYPE.ACT_GROUNDDIE); PopupManager.NotifyPlayerDied(); } + /// + /// Cancel active locomotion when host dies. Push-move reads joystick directly in GetPushDir, + /// so finishing WORK_MOVETOPOS alone is not enough until m_dwMoveRelDir is cleared. + /// + private void StopHostMovementOnDeath() + { + m_dwMoveRelDir = 0; + + if (m_pWorkMan == null) + return; + + if (m_pWorkMan.IsFollowing()) + m_pWorkMan.FinishRunningWork(Host_work_ID.WORK_FOLLOW); + if (m_pWorkMan.IsMovingToPosition()) + m_pWorkMan.FinishRunningWork(Host_work_ID.WORK_MOVETOPOS); + if (m_pWorkMan.IsTracing()) + m_pWorkMan.FinishRunningWork(Host_work_ID.WORK_TRACEOBJECT); + } + private bool NormalAttackObject(int idTarget, bool bForceAttack, bool bMoreClose = false) { if (idTarget == 0 || idTarget == m_PlayerInfo.cid) diff --git a/Assets/Scripts/CECHostPlayer.cs b/Assets/Scripts/CECHostPlayer.cs index 653898cb8f..ad0d5795c0 100644 --- a/Assets/Scripts/CECHostPlayer.cs +++ b/Assets/Scripts/CECHostPlayer.cs @@ -2384,7 +2384,10 @@ namespace BrewMonster public bool GetPushDir(ref Vector3 vPushDir, uint dwMask, float deltaTime) { vPushDir = Vector3.zero; - if (joystick.Horizontal == 0 && joystick.Vertical == 0) + if (IsDead()) + return false; + + if (joystick == null || (joystick.Horizontal == 0 && joystick.Vertical == 0)) { if (isPressMoveUp) {