Merge pull request #8164 from murpii/pr_teleport_reset_jumps

Refresh air jumps after teleporting
This commit is contained in:
Dennis Felsing 2024-04-15 01:31:50 +00:00 committed by GitHub
commit fe41f58197
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 11 additions and 0 deletions

View file

@ -1700,6 +1700,7 @@ void CGameContext::ConTeleTo(IConsole::IResult *pResult, void *pUserData)
// Teleport tee
pSelf->Teleport(pCallingCharacter, Pos);
pCallingCharacter->ResetJumps();
pCallingCharacter->UnFreeze();
pCallingCharacter->ResetVelocity();
pCallingPlayer->m_LastTeleTee.Save(pCallingCharacter);
@ -1777,6 +1778,7 @@ void CGameContext::ConTeleXY(IConsole::IResult *pResult, void *pUserData)
// Teleport tee
pSelf->Teleport(pCallingCharacter, Pos);
pCallingCharacter->ResetJumps();
pCallingCharacter->UnFreeze();
pCallingCharacter->ResetVelocity();
pCallingPlayer->m_LastTeleTee.Save(pCallingCharacter);
@ -1829,6 +1831,7 @@ void CGameContext::ConTeleCursor(IConsole::IResult *pResult, void *pUserData)
Pos = pChrTo->m_Pos;
}
pSelf->Teleport(pChr, Pos);
pChr->ResetJumps();
pChr->UnFreeze();
pChr->ResetVelocity();
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);
}
pSelf->Teleport(pChr, Pos);
pChr->ResetJumps();
pChr->UnFreeze();
pChr->SetVelocity(vec2(0, 0));
}

View file

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

View file

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