Merge pull request 'Fix stop taken joystick value when player dead' (#451) from feature/ivtr-operation into develop

Reviewed-on: https://git.pthub.vn/Unity/perfect-world-unity/pulls/451
This commit is contained in:
hungdk
2026-05-19 09:19:44 +00:00
3 changed files with 32 additions and 1 deletions
+22
View File
@@ -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();
}
/// <summary>
/// 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.
/// </summary>
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)
+4 -1
View File
@@ -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)
{