Menu

#1 Error in NSpGame::FillInGroups()  Edit

Current_Release
open
5
2014-08-23
2004-10-18
Anonymous
No

ddearing@bigfoot.com
NSpGame::FillInGroups()
Line 1080:

found = false;

while (playerIterator->Next(&theItem) && !found)
{
thePlayer = (PlayerListItem )
((UInt32ListMember
)theItem)->GetValue();

if (thePlayer->id == inPlayer)
{
    found = true;
}

}

groups[groupCount++] = theGroup->id;

This unconditionally adds the group to the list, whether
or not the player was found in the group. Plus the use
of the found flag would be clunky even if it worked. Try
This:

while ( playerIterator->Next(&theItem) )
{
thePlayer = (PlayerListItem )
((UInt32ListMember
)theItem)->GetValue();

if (thePlayer->id == inPlayer)
{
                      groups[groupCount++] = theGroup-

id;
break;
}
}

Discussion

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB