mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-09 09:38:19 +00:00
Add /lasttp to hot reload
This commit is contained in:
parent
e0a95d14a6
commit
eb9e73f68b
|
@ -123,6 +123,13 @@ bool CCharacter::Spawn(CPlayer *pPlayer, vec2 Pos)
|
|||
delete GameServer()->m_apSavedTees[m_pPlayer->GetCid()];
|
||||
GameServer()->m_apSavedTees[m_pPlayer->GetCid()] = nullptr;
|
||||
}
|
||||
|
||||
if(GameServer()->m_apSavedTeleTees[m_pPlayer->GetCid()])
|
||||
{
|
||||
m_pPlayer->m_LastTeleTee = *GameServer()->m_apSavedTeleTees[m_pPlayer->GetCid()];
|
||||
delete GameServer()->m_apSavedTeleTees[m_pPlayer->GetCid()];
|
||||
GameServer()->m_apSavedTeleTees[m_pPlayer->GetCid()] = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -108,6 +108,9 @@ void CGameContext::Construct(int Resetting)
|
|||
for(auto &pSavedTee : m_apSavedTees)
|
||||
pSavedTee = nullptr;
|
||||
|
||||
for(auto &pSavedTeleTee : m_apSavedTeleTees)
|
||||
pSavedTeleTee = nullptr;
|
||||
|
||||
for(auto &pSavedTeam : m_apSavedTeams)
|
||||
pSavedTeam = nullptr;
|
||||
|
||||
|
@ -131,6 +134,9 @@ void CGameContext::Destruct(int Resetting)
|
|||
for(auto &pSavedTee : m_apSavedTees)
|
||||
delete pSavedTee;
|
||||
|
||||
for(auto &pSavedTeleTee : m_apSavedTeleTees)
|
||||
delete pSavedTeleTee;
|
||||
|
||||
for(auto &pSavedTeam : m_apSavedTeams)
|
||||
delete pSavedTeam;
|
||||
|
||||
|
@ -1712,6 +1718,9 @@ void CGameContext::OnClientDrop(int ClientId, const char *pReason)
|
|||
delete m_apSavedTees[ClientId];
|
||||
m_apSavedTees[ClientId] = nullptr;
|
||||
|
||||
delete m_apSavedTeleTees[ClientId];
|
||||
m_apSavedTeleTees[ClientId] = nullptr;
|
||||
|
||||
m_aTeamMapping[ClientId] = -1;
|
||||
|
||||
m_VoteUpdate = true;
|
||||
|
@ -3212,6 +3221,9 @@ void CGameContext::ConHotReload(IConsole::IResult *pResult, void *pUserData)
|
|||
pSelf->m_apSavedTees[i] = new CSaveTee();
|
||||
pSelf->m_apSavedTees[i]->Save(pSelf->GetPlayerChar(i), false);
|
||||
|
||||
if(pSelf->m_apPlayers[i])
|
||||
pSelf->m_apSavedTeleTees[i] = new CSaveTee(pSelf->m_apPlayers[i]->m_LastTeleTee);
|
||||
|
||||
// Save the team state
|
||||
pSelf->m_aTeamMapping[i] = pSelf->GetDDRaceTeam(i);
|
||||
|
||||
|
|
|
@ -183,6 +183,7 @@ public:
|
|||
bool m_aPlayerHasInput[MAX_CLIENTS];
|
||||
CSaveTeam *m_apSavedTeams[MAX_CLIENTS];
|
||||
CSaveTee *m_apSavedTees[MAX_CLIENTS];
|
||||
CSaveTee *m_apSavedTeleTees[MAX_CLIENTS];
|
||||
int m_aTeamMapping[MAX_CLIENTS];
|
||||
|
||||
// returns last input if available otherwise nulled PlayerInput object
|
||||
|
|
Loading…
Reference in a new issue