Remove projectiles on team change

This commit is contained in:
Zwelf 2023-01-04 21:08:47 +01:00
parent c7192d703e
commit 877ab41dd7
3 changed files with 7 additions and 0 deletions

View file

@ -150,6 +150,11 @@ void CGameWorld::Reset()
GameServer()->CreateAllEntities(false);
}
void CGameWorld::RemoveEntitiesFromPlayer(int PlayerId)
{
RemoveEntitiesFromPlayers(&PlayerId, 1);
}
void CGameWorld::RemoveEntitiesFromPlayers(int PlayerIds[], int NumPlayers)
{
for(auto *pEnt : m_apFirstEntityTypes)

View file

@ -121,6 +121,7 @@ public:
*/
void RemoveEntity(CEntity *pEntity);
void RemoveEntitiesFromPlayer(int PlayerId);
void RemoveEntitiesFromPlayers(int PlayerIds[], int NumPlayers);
/*

View file

@ -413,6 +413,7 @@ void CGameTeams::SetForceCharacterTeam(int ClientID, int Team)
GetPlayer(ClientID)->m_VotedForPractice = false;
GetPlayer(ClientID)->m_SwapTargetsClientID = -1;
}
m_pGameContext->m_World.RemoveEntitiesFromPlayer(ClientID);
}
if(Team != TEAM_SUPER && (m_aTeamState[Team] == TEAMSTATE_EMPTY || m_aTeamLocked[Team]))