mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-14 03:58: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;
|
return;
|
||||||
Pos = pChrTo->m_Pos;
|
Pos = pChrTo->m_Pos;
|
||||||
}
|
}
|
||||||
pChr->LastTelePos = Pos;
|
pPlayer->LastTelePos = Pos;
|
||||||
pSelf->Teleport(pChr, Pos);
|
pSelf->Teleport(pChr, Pos);
|
||||||
pChr->UnFreeze();
|
pChr->UnFreeze();
|
||||||
pChr->Core()->m_Vel = vec2(0, 0);
|
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.");
|
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;
|
return;
|
||||||
}
|
}
|
||||||
if(!pChr->LastTelePos.x)
|
if(!pPlayer->LastTelePos.x)
|
||||||
{
|
{
|
||||||
pSelf->SendChatTarget(pPlayer->GetCID(), "You haven't previously teleported. Use /tp before using this command.");
|
pSelf->SendChatTarget(pPlayer->GetCID(), "You haven't previously teleported. Use /tp before using this command.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
pSelf->Teleport(pChr, pChr->LastTelePos);
|
pSelf->Teleport(pChr, pPlayer->LastTelePos);
|
||||||
pChr->UnFreeze();
|
pChr->UnFreeze();
|
||||||
pChr->Core()->m_Vel = vec2(0, 0);
|
pChr->Core()->m_Vel = vec2(0, 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -217,8 +217,6 @@ public:
|
||||||
int m_SpawnTick;
|
int m_SpawnTick;
|
||||||
int m_WeaponChangeTick;
|
int m_WeaponChangeTick;
|
||||||
|
|
||||||
vec2 LastTelePos;
|
|
||||||
|
|
||||||
// Setters/Getters because i don't want to modify vanilla vars access modifiers
|
// Setters/Getters because i don't want to modify vanilla vars access modifiers
|
||||||
int GetLastWeapon() { return m_LastWeapon; }
|
int GetLastWeapon() { return m_LastWeapon; }
|
||||||
void SetLastWeapon(int LastWeap) { m_LastWeapon = LastWeap; }
|
void SetLastWeapon(int LastWeap) { m_LastWeapon = LastWeap; }
|
||||||
|
|
|
@ -220,6 +220,8 @@ public:
|
||||||
bool m_VotedForPractice;
|
bool m_VotedForPractice;
|
||||||
int m_SwapTargetsClientID; //Client ID of the swap target for the given player
|
int m_SwapTargetsClientID; //Client ID of the swap target for the given player
|
||||||
bool m_BirthdayAnnounced;
|
bool m_BirthdayAnnounced;
|
||||||
|
|
||||||
|
vec2 LastTelePos;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue