mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Merge pull request #7391 from furo321/incorrect-ghost
Fix incorrect ghost being loaded with `cl_race_ghost_save_best`
This commit is contained in:
commit
795a2699ef
|
@ -432,14 +432,14 @@ void CGhost::StopRecord(int Time)
|
|||
CMenus::CGhostItem *pOwnGhost = m_pClient->m_Menus.GetOwnGhost();
|
||||
if(Time > 0 && (!pOwnGhost || Time < pOwnGhost->m_Time || !g_Config.m_ClRaceGhostSaveBest))
|
||||
{
|
||||
if(pOwnGhost && pOwnGhost->Active())
|
||||
Unload(pOwnGhost->m_Slot);
|
||||
|
||||
// add to active ghosts
|
||||
int Slot = GetSlot();
|
||||
if(Slot != -1)
|
||||
if(Slot != -1 && (!pOwnGhost || Time < pOwnGhost->m_Time))
|
||||
m_aActiveGhosts[Slot] = std::move(m_CurGhost);
|
||||
|
||||
if(pOwnGhost && pOwnGhost->Active() && Time < pOwnGhost->m_Time)
|
||||
Unload(pOwnGhost->m_Slot);
|
||||
|
||||
// create ghost item
|
||||
CMenus::CGhostItem Item;
|
||||
if(RecordingToFile)
|
||||
|
|
|
@ -956,7 +956,7 @@ void CMenus::UpdateOwnGhost(CGhostItem Item)
|
|||
if(Item.HasFile() || !m_vGhosts[Own].HasFile())
|
||||
DeleteGhostItem(Own);
|
||||
}
|
||||
if(m_vGhosts[Own].m_Time >= Item.m_Time)
|
||||
if(m_vGhosts[Own].m_Time > Item.m_Time)
|
||||
{
|
||||
Item.m_Own = true;
|
||||
m_vGhosts[Own].m_Own = false;
|
||||
|
|
Loading…
Reference in a new issue