Don't reset LastTelePos on death

This commit is contained in:
furo 2023-10-01 18:34:07 +02:00
parent 3ce669df13
commit 6dd43fb086
3 changed files with 5 additions and 5 deletions

View file

@ -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);
}

View file

@ -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; }

View file

@ -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