mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 06:28:19 +00:00
Merge pull request #8164 from murpii/pr_teleport_reset_jumps
Refresh air jumps after teleporting
This commit is contained in:
commit
fe41f58197
|
@ -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);
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -185,6 +185,7 @@ public:
|
|||
bool UnFreeze();
|
||||
void GiveAllWeapons();
|
||||
void ResetPickups();
|
||||
void ResetJumps();
|
||||
int m_DDRaceState;
|
||||
int Team();
|
||||
bool CanCollide(int ClientId);
|
||||
|
|
Loading…
Reference in a new issue