Fix /spec + super crash (fixes #2262)

Thanks to Learath2 for finding a better solution.
This commit is contained in:
def 2020-06-14 15:56:15 +02:00
parent 18f5ae442a
commit e38cd6b6f2

View file

@ -106,7 +106,7 @@ void CGameContext::ConSuper(IConsole::IResult *pResult, void *pUserData)
if (pChr && !pChr->m_Super)
{
pChr->m_Super = true;
pSelf->m_World.m_Core.m_apCharacters[pResult->m_ClientID]->m_Super = true;
pChr->Core()->m_Super = true;
pChr->UnFreeze();
pChr->m_TeamBeforeSuper = pChr->Team();
pChr->Teams()->SetCharacterTeam(pResult->m_ClientID, TEAM_SUPER);
@ -123,7 +123,7 @@ void CGameContext::ConUnSuper(IConsole::IResult *pResult, void *pUserData)
if (pChr && pChr->m_Super)
{
pChr->m_Super = false;
pSelf->m_World.m_Core.m_apCharacters[pResult->m_ClientID]->m_Super = false;
pChr->Core()->m_Super = false;
pChr->Teams()->SetForceCharacterTeam(pResult->m_ClientID,
pChr->m_TeamBeforeSuper);
}