mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-09 17:48:19 +00:00
Fix crash while attached to dragger during hot_reload
This commit is contained in:
parent
0369946156
commit
ad0fc8898f
|
@ -529,12 +529,12 @@ ESaveResult CSaveTeam::Save(CGameContext *pGameServer, int Team, bool Dry, bool
|
||||||
CCharacter *p = (CCharacter *)pGameServer->m_World.FindFirst(CGameWorld::ENTTYPE_CHARACTER);
|
CCharacter *p = (CCharacter *)pGameServer->m_World.FindFirst(CGameWorld::ENTTYPE_CHARACTER);
|
||||||
for(; p; p = (CCharacter *)p->TypeNext())
|
for(; p; p = (CCharacter *)p->TypeNext())
|
||||||
{
|
{
|
||||||
if(pTeams->m_Core.Team(p->GetPlayer()->GetCid()) != Team)
|
if(pTeams->m_Core.Team(p->GetPlayer()->GetCid()) != Team && !Force)
|
||||||
continue;
|
continue;
|
||||||
if(m_MembersCount == j)
|
if(m_MembersCount == j && !Force)
|
||||||
return ESaveResult::CHAR_NOT_FOUND;
|
return ESaveResult::CHAR_NOT_FOUND;
|
||||||
ESaveResult Result = pGameServer->m_World.BlocksSave(p->GetPlayer()->GetCid());
|
ESaveResult Result = pGameServer->m_World.BlocksSave(p->GetPlayer()->GetCid());
|
||||||
if(Result != ESaveResult::SUCCESS)
|
if(Result != ESaveResult::SUCCESS && !Force)
|
||||||
return Result;
|
return Result;
|
||||||
m_pSavedTees[j].Save(p);
|
m_pSavedTees[j].Save(p);
|
||||||
aPlayerCids[j] = p->GetPlayer()->GetCid();
|
aPlayerCids[j] = p->GetPlayer()->GetCid();
|
||||||
|
|
Loading…
Reference in a new issue