mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Set rescue tee immediately after loading (fixes #2248)
This commit is contained in:
parent
cbde23aba9
commit
3530d0ae32
|
@ -2154,6 +2154,12 @@ IAntibot *CCharacter::Antibot()
|
|||
return GameServer()->Antibot();
|
||||
}
|
||||
|
||||
void CCharacter::SetRescue()
|
||||
{
|
||||
m_RescueTee.save(this);
|
||||
m_SetSavePos = true;
|
||||
}
|
||||
|
||||
void CCharacter::DDRaceTick()
|
||||
{
|
||||
mem_copy(&m_Input, &m_SavedInput, sizeof(m_Input));
|
||||
|
@ -2186,15 +2192,13 @@ void CCharacter::DDRaceTick()
|
|||
int tile = GameServer()->Collision()->GetTileIndex(index);
|
||||
int ftile = GameServer()->Collision()->GetFTileIndex(index);
|
||||
if(IsGrounded() && tile != TILE_FREEZE && tile != TILE_DFREEZE && ftile != TILE_FREEZE && ftile != TILE_DFREEZE && !m_DeepFreeze) {
|
||||
m_RescueTee.save(this);
|
||||
m_SetSavePos = true;
|
||||
SetRescue();
|
||||
}
|
||||
}
|
||||
|
||||
m_Core.m_Id = GetPlayer()->GetCID();
|
||||
}
|
||||
|
||||
|
||||
void CCharacter::DDRacePostCoreTick()
|
||||
{
|
||||
m_Time = (float)(Server()->Tick() - m_StartTime) / ((float)Server()->TickSpeed());
|
||||
|
|
|
@ -172,6 +172,7 @@ private:
|
|||
int m_LastBroadcast;
|
||||
void DDRaceInit();
|
||||
void HandleSkippableTiles(int Index);
|
||||
void SetRescue();
|
||||
void DDRaceTick();
|
||||
void DDRacePostCoreTick();
|
||||
void HandleBroadcast();
|
||||
|
|
|
@ -182,6 +182,10 @@ void CSaveTee::load(CCharacter *pChr, int Team)
|
|||
}
|
||||
|
||||
pChr->SetSolo(m_IsSolo);
|
||||
|
||||
// Always create a rescue tee at the exact location we loaded from so that
|
||||
// the old one gets overwritten.
|
||||
pChr->SetRescue();
|
||||
}
|
||||
|
||||
char* CSaveTee::GetString()
|
||||
|
|
Loading…
Reference in a new issue