Set rescue tee immediately after loading (fixes #2248)

This commit is contained in:
def 2020-06-24 21:19:46 +02:00
parent cbde23aba9
commit 3530d0ae32
3 changed files with 12 additions and 3 deletions

View file

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

View file

@ -172,6 +172,7 @@ private:
int m_LastBroadcast;
void DDRaceInit();
void HandleSkippableTiles(int Index);
void SetRescue();
void DDRaceTick();
void DDRacePostCoreTick();
void HandleBroadcast();

View file

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