forked from 0ad/0ad
Fix more then one observer by allowing a game to have multiple players with the -1 ID.
This was SVN commit r14885.
This commit is contained in:
parent
22867fa9a3
commit
a7b2f6ba47
@ -597,10 +597,10 @@ void CNetServerWorker::OnUserLeave(CNetServerSession* session)
|
||||
|
||||
void CNetServerWorker::AddPlayer(const CStr& guid, const CStrW& name)
|
||||
{
|
||||
// Find all player IDs in active use; we mustn't give them to a second player
|
||||
// Find all player IDs in active use; we mustn't give them to a second player (excluding the unassigned ID: -1)
|
||||
std::set<i32> usedIDs;
|
||||
for (PlayerAssignmentMap::iterator it = m_PlayerAssignments.begin(); it != m_PlayerAssignments.end(); ++it)
|
||||
if (it->second.m_Enabled)
|
||||
if (it->second.m_Enabled && it->second.m_PlayerID != -1)
|
||||
usedIDs.insert(it->second.m_PlayerID);
|
||||
|
||||
// If the player is rejoining after disconnecting, try to give them
|
||||
|
Loading…
Reference in New Issue
Block a user