2354: Set rescue tee immediately after loading (fixes #2248) r=heinrich5991 a=def-



Co-authored-by: def <dennis@felsin9.de>
This commit is contained in:
bors[bot] 2020-06-24 21:37:47 +00:00 committed by GitHub
commit bad43e77a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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()