Fix crash while attached to dragger during hot_reload

This commit is contained in:
furo 2024-09-16 13:52:49 +02:00
parent 0369946156
commit ad0fc8898f

View file

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