修复状态机bug

This commit is contained in:
ALIENJACK\alien 2025-08-18 18:27:28 +08:00
parent 15c64ae655
commit 629cd16016

View File

@ -75,9 +75,12 @@ namespace AxibugEmuOnline.Client.Tools
if (nextState == null) return;
if (m_current != null) m_current.OnExit(nextState);
nextState.LastState = m_current;
nextState.OnEnter(m_current);
var preState = m_current;
m_current = nextState;
m_current.LastState = preState;
m_current.OnEnter(preState);
}
public T GetState<T>() where T : State, new()