Refresh the jumps after teleporting

This commit is contained in:
murpii 2024-03-29 13:40:45 +01:00
parent 3eda861c37
commit ed90392636
4 changed files with 11 additions and 0 deletions

View file

@ -1605,6 +1605,7 @@ void CGameContext::ConTeleTo(IConsole::IResult *pResult, void *pUserData)
// Teleport tee // Teleport tee
pSelf->Teleport(pCallingCharacter, Pos); pSelf->Teleport(pCallingCharacter, Pos);
pCallingCharacter->ResetJumps();
pCallingCharacter->UnFreeze(); pCallingCharacter->UnFreeze();
pCallingCharacter->ResetVelocity(); pCallingCharacter->ResetVelocity();
pCallingPlayer->m_LastTeleTee.Save(pCallingCharacter); pCallingPlayer->m_LastTeleTee.Save(pCallingCharacter);
@ -1682,6 +1683,7 @@ void CGameContext::ConTeleXY(IConsole::IResult *pResult, void *pUserData)
// Teleport tee // Teleport tee
pSelf->Teleport(pCallingCharacter, Pos); pSelf->Teleport(pCallingCharacter, Pos);
pCallingCharacter->ResetJumps();
pCallingCharacter->UnFreeze(); pCallingCharacter->UnFreeze();
pCallingCharacter->ResetVelocity(); pCallingCharacter->ResetVelocity();
pCallingPlayer->m_LastTeleTee.Save(pCallingCharacter); pCallingPlayer->m_LastTeleTee.Save(pCallingCharacter);
@ -1734,6 +1736,7 @@ void CGameContext::ConTeleCursor(IConsole::IResult *pResult, void *pUserData)
Pos = pChrTo->m_Pos; Pos = pChrTo->m_Pos;
} }
pSelf->Teleport(pChr, Pos); pSelf->Teleport(pChr, Pos);
pChr->ResetJumps();
pChr->UnFreeze(); pChr->UnFreeze();
pChr->ResetVelocity(); pChr->ResetVelocity();
pPlayer->m_LastTeleTee.Save(pChr); pPlayer->m_LastTeleTee.Save(pChr);

View file

@ -413,6 +413,7 @@ void CGameContext::ConTeleport(IConsole::IResult *pResult, void *pUserData)
Pos += vec2(pChr->Core()->m_Input.m_TargetX, pChr->Core()->m_Input.m_TargetY); Pos += vec2(pChr->Core()->m_Input.m_TargetX, pChr->Core()->m_Input.m_TargetY);
} }
pSelf->Teleport(pChr, Pos); pSelf->Teleport(pChr, Pos);
pChr->ResetJumps();
pChr->UnFreeze(); pChr->UnFreeze();
pChr->SetVelocity(vec2(0, 0)); pChr->SetVelocity(vec2(0, 0));
} }

View file

@ -2197,6 +2197,12 @@ bool CCharacter::UnFreeze()
return false; return false;
} }
void CCharacter::ResetJumps()
{
m_Core.m_JumpedTotal = 0;
m_Core.m_Jumped = 0;
}
void CCharacter::GiveWeapon(int Weapon, bool Remove) void CCharacter::GiveWeapon(int Weapon, bool Remove)
{ {
if(Weapon == WEAPON_NINJA) if(Weapon == WEAPON_NINJA)

View file

@ -185,6 +185,7 @@ public:
bool UnFreeze(); bool UnFreeze();
void GiveAllWeapons(); void GiveAllWeapons();
void ResetPickups(); void ResetPickups();
void ResetJumps();
int m_DDRaceState; int m_DDRaceState;
int Team(); int Team();
bool CanCollide(int ClientId); bool CanCollide(int ClientId);