Fixed searching for clusters with no Alpha stars (Corvi)
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2191 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -878,6 +878,29 @@ SplitStarName (STAR_SEARCH_STATE *pSS)
|
|||||||
pSS->PrefixLen = utf8StringCount (pSS->Prefix);
|
pSS->PrefixLen = utf8StringCount (pSS->Prefix);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
GetFirstClusterStar (BYTE Postfix)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
int min = -1;
|
||||||
|
int min_pref = 1000;
|
||||||
|
STAR_DESCPTR SDPtr;
|
||||||
|
|
||||||
|
for (i = 0, SDPtr = star_array; i < NUM_SOLAR_SYSTEMS; ++i, ++SDPtr)
|
||||||
|
{
|
||||||
|
if (SDPtr->Postfix != Postfix)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (SDPtr->Prefix < min_pref)
|
||||||
|
{
|
||||||
|
min_pref = SDPtr->Prefix;
|
||||||
|
min = i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return min;
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
FindNextStar (STAR_SEARCH_STATE *pSS, int from, BOOLEAN WithinClust)
|
FindNextStar (STAR_SEARCH_STATE *pSS, int from, BOOLEAN WithinClust)
|
||||||
{
|
{
|
||||||
@@ -920,8 +943,8 @@ FindNextStar (STAR_SEARCH_STATE *pSS, int from, BOOLEAN WithinClust)
|
|||||||
|
|
||||||
if (!pSS->Prefix)
|
if (!pSS->Prefix)
|
||||||
{ // searching for cluster name only
|
{ // searching for cluster name only
|
||||||
// only return Alpha stars
|
// return only the first stars in a cluster
|
||||||
if (SDPtr->Prefix == 1)
|
if (i == GetFirstClusterStar (SDPtr->Postfix))
|
||||||
break;
|
break;
|
||||||
else
|
else
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user