mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Merge pull request #7280 from furo321/move-lasttelepos
Don't reset `/lasttp` position on death
This commit is contained in:
commit
624f4aef21
|
@ -1540,7 +1540,7 @@ void CGameContext::ConTele(IConsole::IResult *pResult, void *pUserData)
|
|||
return;
|
||||
Pos = pChrTo->m_Pos;
|
||||
}
|
||||
pChr->LastTelePos = Pos;
|
||||
pPlayer->LastTelePos = Pos;
|
||||
pSelf->Teleport(pChr, Pos);
|
||||
pChr->UnFreeze();
|
||||
pChr->Core()->m_Vel = vec2(0, 0);
|
||||
|
@ -1565,12 +1565,12 @@ void CGameContext::ConLastTele(IConsole::IResult *pResult, void *pUserData)
|
|||
pSelf->SendChatTarget(pPlayer->GetCID(), "You're not in a team with /practice turned on. Note that you can't earn a rank with practice enabled.");
|
||||
return;
|
||||
}
|
||||
if(!pChr->LastTelePos.x)
|
||||
if(!pPlayer->LastTelePos.x)
|
||||
{
|
||||
pSelf->SendChatTarget(pPlayer->GetCID(), "You haven't previously teleported. Use /tp before using this command.");
|
||||
return;
|
||||
}
|
||||
pSelf->Teleport(pChr, pChr->LastTelePos);
|
||||
pSelf->Teleport(pChr, pPlayer->LastTelePos);
|
||||
pChr->UnFreeze();
|
||||
pChr->Core()->m_Vel = vec2(0, 0);
|
||||
}
|
||||
|
|
|
@ -217,8 +217,6 @@ public:
|
|||
int m_SpawnTick;
|
||||
int m_WeaponChangeTick;
|
||||
|
||||
vec2 LastTelePos;
|
||||
|
||||
// Setters/Getters because i don't want to modify vanilla vars access modifiers
|
||||
int GetLastWeapon() { return m_LastWeapon; }
|
||||
void SetLastWeapon(int LastWeap) { m_LastWeapon = LastWeap; }
|
||||
|
|
|
@ -220,6 +220,8 @@ public:
|
|||
bool m_VotedForPractice;
|
||||
int m_SwapTargetsClientID; //Client ID of the swap target for the given player
|
||||
bool m_BirthdayAnnounced;
|
||||
|
||||
vec2 LastTelePos;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue