rem: GetClusterName (CurStarDescPtr, buf); printf ("cluster name = %s  color = %c type = %c\n", buf, scolor[STAR_COLOR (CurStarDescPtr->Type)], stype[STAR_TYPE (CurStarDescPtr->Type)]);
add: GetClusterName (CurStarDescPtr, buf); fprintf (stderr, "cluster name = %s  color = %c type = %c\n", buf, scolor[STAR_COLOR (CurStarDescPtr->Type)], stype[STAR_TYPE (CurStarDescPtr->Type)]);
context: FillOrbits (BYTE NumPlanets, PPLANET_DESC pBaseDesc, BOOLEAN		TypesDefined){ /* Generate Planets in orbit around star */	BYTE StarColor, PlanetCount, MaxPlanet;	BOOLEAN GeneratingMoons;	COUNT StarSize;	PPLANET_DESC pPD;	struct	{		COUNT MinRockyDist, MinGasGDist;	} Suns[] =	{		{DWARF_ROCK_DIST, DWARF_GASG_DIST},		{GIANT_ROCK_DIST, GIANT_GASG_DIST},		{SUPERGIANT_ROCK_DIST, SUPERGIANT_GASG_DIST},	};#ifdef DEBUGUNICODE buf[40];char stype[] = {'D', 'G', 'S'};char scolor[] = {'B', 'G', 'O', 'R', 'W', 'Y'};#endif /* DEBUG */	pPD = pBaseDesc;	StarSize = pSolarSysState->SunDesc[0].data_index;	StarColor = STAR_COLOR (CurStarDescPtr->Type);	if (NumPlanets == (BYTE)~0)	{#define MAX_GENERATED_PLANETS 10		while ((NumPlanets = (BYTE)(LOWORD (Random())				% MAX_GENERATED_PLANETS)) == 0)			;		pSolarSysState->SunDesc[0].NumPlanets = NumPlanets;	}#ifdef DEBUGGetClusterName (CurStarDescPtr, buf);printf ("cluster name = %s  color = %c type = %c\n", buf,		scolor[STAR_COLOR (CurStarDescPtr->Type)],		stype[STAR_TYPE (CurStarDescPtr->Type)]);#endif /* DEBUG */	GeneratingMoons = (BOOLEAN) (pBaseDesc == pSolarSysState->MoonDesc);	if (GeneratingMoons)		MaxPlanet = FIRST_LARGE_ROCKY_WORLD;	else		MaxPlanet = NUMBER_OF_PLANET_TYPES;	PlanetCount = NumPlanets;	while (NumPlanets--)	{		BYTE chance;		DWORD rand_val;		COUNT min_radius, angle;		SIZE delta_r;		PPLANET_DESC pLocPD;		do		{			rand_val = Random ();			if (TypesDefined)				rand_val = 0;			else				pPD->data_index = (BYTE)(						HIBYTE (LOWORD (rand_val))						% MaxPlanet						);			chance = PLANET_NEVER;			switch (StarColor)			{				case BLUE_BODY:					chance = BlueDistribution (pPD->data_index);					break;				case GREEN_BODY:					chance = GreenDistribution (pPD->data_index);					break;				case ORANGE_BODY:					chance = OrangeDistribution (pPD->data_index);					break;				case RED_BODY:					chance = RedDistribution (pPD->data_index);					break;				case WHITE_BODY:					chance = WhiteDistribution (pPD->data_index);					break;				case YELLOW_BODY:					chance = YellowDistribution (pPD->data_index);					break;			}		} while (LOBYTE (LOWORD (rand_val)) >= chance);		if (pPD->data_index < FIRST_GAS_GIANT)			min_radius = Suns[StarSize].MinRockyDist;		else			min_radius = Suns[StarSize].MinGasGDist;RelocatePlanet:		rand_val = Random ();		if (GeneratingMoons)		{			pPD->radius = MIN_MOON_RADIUS					+ ((LOWORD (rand_val) % MAX_MOONS) * MOON_DELTA);			for (pLocPD = pPD - 1; pLocPD >= pBaseDesc; --pLocPD)			{				if (pPD->radius == pLocPD->radius)					goto RelocatePlanet;			}			pPD->NumPlanets = 0;		}		else		{			pPD->radius =  (LOWORD (rand_val)					% (MAX_PLANET_RADIUS - min_radius))					+ min_radius;			for (pLocPD = pPD - 1; pLocPD >= pBaseDesc; --pLocPD)			{				delta_r = UNSCALE_RADIUS (pLocPD->radius) / 5						- UNSCALE_RADIUS (pPD->radius) / 5;				if (delta_r < 0)					delta_r = -delta_r;				if (delta_r <= 1)					goto RelocatePlanet;			}		}		rand_val = Random ();		angle = NORMALIZE_ANGLE (LOWORD (rand_val));		pPD->location.x =				COSINE (angle, pPD->radius);		pPD->location.y =				SINE (angle, pPD->radius);		pPD->rand_seed = MAKE_DWORD (				pPD->location.x,				pPD->location.y				);		++pPD;	}	{		BYTE i;		for (i = 0; i < PlanetCount; ++i)		{			BYTE j;			for (j = (BYTE)(PlanetCount - 1); j > i; --j)			{				if (pBaseDesc[i].radius > pBaseDesc[j].radius)				{					PLANET_DESC temp;					temp = pBaseDesc[i];					pBaseDesc[i] = pBaseDesc[j];					pBaseDesc[j] = temp;				}			}		}	}}