Get rid of dual identical counters in generation code and reformat the loops
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3580 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -125,14 +125,11 @@ GenerateAndrosynth_generateEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
|
|||||||
if (matchWorld (solarSys, world, 1, MATCH_PLANET))
|
if (matchWorld (solarSys, world, 1, MATCH_PLANET))
|
||||||
{
|
{
|
||||||
COUNT i;
|
COUNT i;
|
||||||
COUNT nodeI;
|
|
||||||
|
|
||||||
old_rand = TFB_SeedRandom (
|
old_rand = TFB_SeedRandom (
|
||||||
solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]);
|
solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]);
|
||||||
|
|
||||||
nodeI = 0;
|
for (i = 0; i < 16; ++i)
|
||||||
i = 0;
|
|
||||||
do
|
|
||||||
{
|
{
|
||||||
rand_val = TFB_Random ();
|
rand_val = TFB_Random ();
|
||||||
solarSys->SysInfo.PlanetInfo.CurPt.x =
|
solarSys->SysInfo.PlanetInfo.CurPt.x =
|
||||||
@@ -167,11 +164,10 @@ GenerateAndrosynth_generateEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nodeI >= *whichNode)
|
if (i >= *whichNode)
|
||||||
break;
|
break;
|
||||||
++nodeI;
|
}
|
||||||
} while (++i < 16);
|
*whichNode = i;
|
||||||
*whichNode = nodeI;
|
|
||||||
|
|
||||||
TFB_SeedRandom (old_rand);
|
TFB_SeedRandom (old_rand);
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -143,15 +143,12 @@ GenerateBurvixese_generateEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
|
|||||||
|
|
||||||
if (matchWorld (solarSys, world, 0, MATCH_PLANET))
|
if (matchWorld (solarSys, world, 0, MATCH_PLANET))
|
||||||
{
|
{
|
||||||
COUNT nodeI;
|
|
||||||
COUNT i;
|
COUNT i;
|
||||||
|
|
||||||
old_rand = TFB_SeedRandom (
|
old_rand = TFB_SeedRandom (
|
||||||
solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]);
|
solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]);
|
||||||
|
|
||||||
nodeI = 0;
|
for (i = 0; i < 16; ++i)
|
||||||
i = 0;
|
|
||||||
do
|
|
||||||
{
|
{
|
||||||
rand_val = TFB_Random ();
|
rand_val = TFB_Random ();
|
||||||
solarSys->SysInfo.PlanetInfo.CurPt.x =
|
solarSys->SysInfo.PlanetInfo.CurPt.x =
|
||||||
@@ -160,11 +157,10 @@ GenerateBurvixese_generateEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
|
|||||||
(HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8;
|
(HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8;
|
||||||
solarSys->SysInfo.PlanetInfo.CurType = 1;
|
solarSys->SysInfo.PlanetInfo.CurType = 1;
|
||||||
solarSys->SysInfo.PlanetInfo.CurDensity = 0;
|
solarSys->SysInfo.PlanetInfo.CurDensity = 0;
|
||||||
if (nodeI >= *whichNode)
|
if (i >= *whichNode)
|
||||||
break;
|
break;
|
||||||
++nodeI;
|
}
|
||||||
} while (++i < 16);
|
*whichNode = i;
|
||||||
*whichNode = nodeI;
|
|
||||||
|
|
||||||
TFB_SeedRandom (old_rand);
|
TFB_SeedRandom (old_rand);
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -131,16 +131,13 @@ GenerateDruuge_generateEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
|
|||||||
if (matchWorld (solarSys, world, 0, MATCH_PLANET))
|
if (matchWorld (solarSys, world, 0, MATCH_PLANET))
|
||||||
{
|
{
|
||||||
COUNT i;
|
COUNT i;
|
||||||
COUNT nodeI;
|
|
||||||
DWORD rand_val;
|
DWORD rand_val;
|
||||||
DWORD old_rand;
|
DWORD old_rand;
|
||||||
|
|
||||||
old_rand = TFB_SeedRandom (
|
old_rand = TFB_SeedRandom (
|
||||||
solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]);
|
solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]);
|
||||||
|
|
||||||
nodeI = 0;
|
for (i = 0; i < 16; ++i)
|
||||||
i = 0;
|
|
||||||
do
|
|
||||||
{
|
{
|
||||||
rand_val = TFB_Random ();
|
rand_val = TFB_Random ();
|
||||||
solarSys->SysInfo.PlanetInfo.CurPt.x =
|
solarSys->SysInfo.PlanetInfo.CurPt.x =
|
||||||
@@ -166,11 +163,10 @@ GenerateDruuge_generateEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
|
|||||||
SET_GAME_STATE (ROSY_SPHERE_ON_SHIP, 1);
|
SET_GAME_STATE (ROSY_SPHERE_ON_SHIP, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (nodeI >= *whichNode)
|
if (i >= *whichNode)
|
||||||
break;
|
break;
|
||||||
++nodeI;
|
}
|
||||||
} while (++i < 16);
|
*whichNode = i;
|
||||||
*whichNode = nodeI;
|
|
||||||
|
|
||||||
TFB_SeedRandom (old_rand);
|
TFB_SeedRandom (old_rand);
|
||||||
|
|
||||||
|
|||||||
@@ -124,16 +124,13 @@ GenerateIlwrath_generateEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
|
|||||||
if (matchWorld (solarSys, world, 0, MATCH_PLANET))
|
if (matchWorld (solarSys, world, 0, MATCH_PLANET))
|
||||||
{
|
{
|
||||||
COUNT i;
|
COUNT i;
|
||||||
COUNT nodeI;
|
|
||||||
DWORD rand_val;
|
DWORD rand_val;
|
||||||
DWORD old_rand;
|
DWORD old_rand;
|
||||||
|
|
||||||
old_rand = TFB_SeedRandom (
|
old_rand = TFB_SeedRandom (
|
||||||
solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]);
|
solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]);
|
||||||
|
|
||||||
nodeI = 0;
|
for (i = 0; i < 16; ++i)
|
||||||
i = 0;
|
|
||||||
do
|
|
||||||
{
|
{
|
||||||
rand_val = TFB_Random ();
|
rand_val = TFB_Random ();
|
||||||
solarSys->SysInfo.PlanetInfo.CurPt.x =
|
solarSys->SysInfo.PlanetInfo.CurPt.x =
|
||||||
@@ -142,11 +139,10 @@ GenerateIlwrath_generateEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
|
|||||||
(HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8;
|
(HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8;
|
||||||
solarSys->SysInfo.PlanetInfo.CurType = 1;
|
solarSys->SysInfo.PlanetInfo.CurType = 1;
|
||||||
solarSys->SysInfo.PlanetInfo.CurDensity = 0;
|
solarSys->SysInfo.PlanetInfo.CurDensity = 0;
|
||||||
if (nodeI >= *whichNode)
|
if (i >= *whichNode)
|
||||||
break;
|
break;
|
||||||
++nodeI;
|
}
|
||||||
} while (++i < 16);
|
*whichNode = i;
|
||||||
*whichNode = nodeI;
|
|
||||||
|
|
||||||
TFB_SeedRandom (old_rand);
|
TFB_SeedRandom (old_rand);
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -207,14 +207,11 @@ GenerateOrz_generateEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
|
|||||||
&& matchWorld (solarSys, world, 0, MATCH_PLANET))
|
&& matchWorld (solarSys, world, 0, MATCH_PLANET))
|
||||||
{
|
{
|
||||||
COUNT i;
|
COUNT i;
|
||||||
COUNT nodeI;
|
|
||||||
|
|
||||||
old_rand = TFB_SeedRandom (
|
old_rand = TFB_SeedRandom (
|
||||||
solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]);
|
solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]);
|
||||||
|
|
||||||
nodeI = 0;
|
for (i = 0; i < 16; ++i)
|
||||||
i = 0;
|
|
||||||
do
|
|
||||||
{
|
{
|
||||||
rand_val = TFB_Random ();
|
rand_val = TFB_Random ();
|
||||||
solarSys->SysInfo.PlanetInfo.CurPt.x =
|
solarSys->SysInfo.PlanetInfo.CurPt.x =
|
||||||
@@ -223,11 +220,10 @@ GenerateOrz_generateEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
|
|||||||
(HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8;
|
(HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8;
|
||||||
solarSys->SysInfo.PlanetInfo.CurType = 1;
|
solarSys->SysInfo.PlanetInfo.CurType = 1;
|
||||||
solarSys->SysInfo.PlanetInfo.CurDensity = 0;
|
solarSys->SysInfo.PlanetInfo.CurDensity = 0;
|
||||||
if (nodeI >= *whichNode)
|
if (i >= *whichNode)
|
||||||
break;
|
break;
|
||||||
++nodeI;
|
}
|
||||||
} while (++i < 16);
|
*whichNode = i;
|
||||||
*whichNode = nodeI;
|
|
||||||
|
|
||||||
TFB_SeedRandom (old_rand);
|
TFB_SeedRandom (old_rand);
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -161,16 +161,13 @@ GenerateTalkingPet_generateEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
|
|||||||
if (matchWorld (solarSys, world, 0, MATCH_PLANET))
|
if (matchWorld (solarSys, world, 0, MATCH_PLANET))
|
||||||
{
|
{
|
||||||
COUNT i;
|
COUNT i;
|
||||||
COUNT nodeI;
|
|
||||||
DWORD rand_val;
|
DWORD rand_val;
|
||||||
COUNT old_rand;
|
COUNT old_rand;
|
||||||
|
|
||||||
old_rand = TFB_SeedRandom (
|
old_rand = TFB_SeedRandom (
|
||||||
solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]);
|
solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]);
|
||||||
|
|
||||||
nodeI = 0;
|
for (i = 0; i < 16; ++i)
|
||||||
i = 0;
|
|
||||||
do
|
|
||||||
{
|
{
|
||||||
rand_val = TFB_Random ();
|
rand_val = TFB_Random ();
|
||||||
solarSys->SysInfo.PlanetInfo.CurPt.x =
|
solarSys->SysInfo.PlanetInfo.CurPt.x =
|
||||||
@@ -179,11 +176,10 @@ GenerateTalkingPet_generateEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
|
|||||||
(HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8;
|
(HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8;
|
||||||
solarSys->SysInfo.PlanetInfo.CurType = 1;
|
solarSys->SysInfo.PlanetInfo.CurType = 1;
|
||||||
solarSys->SysInfo.PlanetInfo.CurDensity = 0;
|
solarSys->SysInfo.PlanetInfo.CurDensity = 0;
|
||||||
if (nodeI >= *whichNode)
|
if (i >= *whichNode)
|
||||||
break;
|
break;
|
||||||
++nodeI;
|
}
|
||||||
} while (++i < 16);
|
*whichNode = i;
|
||||||
*whichNode = nodeI;
|
|
||||||
|
|
||||||
TFB_SeedRandom (old_rand);
|
TFB_SeedRandom (old_rand);
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -121,16 +121,13 @@ GeneratePkunk_generateEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
|
|||||||
if (matchWorld (solarSys, world, 0, MATCH_PLANET))
|
if (matchWorld (solarSys, world, 0, MATCH_PLANET))
|
||||||
{
|
{
|
||||||
COUNT i;
|
COUNT i;
|
||||||
COUNT nodeI;
|
|
||||||
DWORD rand_val;
|
DWORD rand_val;
|
||||||
DWORD old_rand;
|
DWORD old_rand;
|
||||||
|
|
||||||
old_rand = TFB_SeedRandom (
|
old_rand = TFB_SeedRandom (
|
||||||
solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]);
|
solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]);
|
||||||
|
|
||||||
nodeI = 0;
|
for (i = 0; i < 16; ++i)
|
||||||
i = 0;
|
|
||||||
do
|
|
||||||
{
|
{
|
||||||
rand_val = TFB_Random ();
|
rand_val = TFB_Random ();
|
||||||
solarSys->SysInfo.PlanetInfo.CurPt.x =
|
solarSys->SysInfo.PlanetInfo.CurPt.x =
|
||||||
@@ -156,11 +153,10 @@ GeneratePkunk_generateEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
|
|||||||
SET_GAME_STATE (CLEAR_SPINDLE_ON_SHIP, 1);
|
SET_GAME_STATE (CLEAR_SPINDLE_ON_SHIP, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (nodeI >= *whichNode)
|
if (i >= *whichNode)
|
||||||
break;
|
break;
|
||||||
++nodeI;
|
}
|
||||||
} while (++i < 16);
|
*whichNode = i;
|
||||||
*whichNode = nodeI;
|
|
||||||
|
|
||||||
TFB_SeedRandom (old_rand);
|
TFB_SeedRandom (old_rand);
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -576,16 +576,13 @@ GenerateSol_generateLife (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
|
|||||||
else /* Earth Moon */
|
else /* Earth Moon */
|
||||||
{
|
{
|
||||||
COUNT i;
|
COUNT i;
|
||||||
COUNT nodeI;
|
|
||||||
DWORD old_rand;
|
DWORD old_rand;
|
||||||
DWORD rand_val;
|
DWORD rand_val;
|
||||||
|
|
||||||
old_rand = TFB_SeedRandom (
|
old_rand = TFB_SeedRandom (
|
||||||
solarSys->SysInfo.PlanetInfo.ScanSeed[BIOLOGICAL_SCAN]);
|
solarSys->SysInfo.PlanetInfo.ScanSeed[BIOLOGICAL_SCAN]);
|
||||||
|
|
||||||
nodeI = 0;
|
for (i = 0; i < 10; ++i)
|
||||||
i = 0;
|
|
||||||
do
|
|
||||||
{
|
{
|
||||||
rand_val = TFB_Random ();
|
rand_val = TFB_Random ();
|
||||||
solarSys->SysInfo.PlanetInfo.CurPt.x =
|
solarSys->SysInfo.PlanetInfo.CurPt.x =
|
||||||
@@ -593,11 +590,10 @@ GenerateSol_generateLife (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
|
|||||||
solarSys->SysInfo.PlanetInfo.CurPt.y =
|
solarSys->SysInfo.PlanetInfo.CurPt.y =
|
||||||
(HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8;
|
(HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8;
|
||||||
solarSys->SysInfo.PlanetInfo.CurType = NUM_CREATURE_TYPES + 1;
|
solarSys->SysInfo.PlanetInfo.CurType = NUM_CREATURE_TYPES + 1;
|
||||||
if (nodeI >= *whichNode)
|
if (i >= *whichNode)
|
||||||
break;
|
break;
|
||||||
++nodeI;
|
}
|
||||||
} while (++i < 10);
|
*whichNode = i;
|
||||||
*whichNode = nodeI;
|
|
||||||
|
|
||||||
TFB_SeedRandom (old_rand);
|
TFB_SeedRandom (old_rand);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -242,15 +242,12 @@ GenerateSpathi_generateLife (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
|
|||||||
&& !GET_GAME_STATE (SPATHI_SHIELDED_SELVES))
|
&& !GET_GAME_STATE (SPATHI_SHIELDED_SELVES))
|
||||||
{
|
{
|
||||||
COUNT i;
|
COUNT i;
|
||||||
COUNT nodeI;
|
|
||||||
DWORD old_rand;
|
DWORD old_rand;
|
||||||
|
|
||||||
old_rand = TFB_SeedRandom (
|
old_rand = TFB_SeedRandom (
|
||||||
solarSys->SysInfo.PlanetInfo.ScanSeed[BIOLOGICAL_SCAN]);
|
solarSys->SysInfo.PlanetInfo.ScanSeed[BIOLOGICAL_SCAN]);
|
||||||
|
|
||||||
nodeI = 0;
|
for (i = 0; i < 32; ++i)
|
||||||
i = 0;
|
|
||||||
do
|
|
||||||
{
|
{
|
||||||
DWORD rand_val = TFB_Random ();
|
DWORD rand_val = TFB_Random ();
|
||||||
solarSys->SysInfo.PlanetInfo.CurPt.x =
|
solarSys->SysInfo.PlanetInfo.CurPt.x =
|
||||||
@@ -258,11 +255,10 @@ GenerateSpathi_generateLife (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
|
|||||||
solarSys->SysInfo.PlanetInfo.CurPt.y =
|
solarSys->SysInfo.PlanetInfo.CurPt.y =
|
||||||
(HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8;
|
(HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8;
|
||||||
solarSys->SysInfo.PlanetInfo.CurType = NUM_CREATURE_TYPES;
|
solarSys->SysInfo.PlanetInfo.CurType = NUM_CREATURE_TYPES;
|
||||||
if (nodeI >= *whichNode)
|
if (i >= *whichNode)
|
||||||
break;
|
break;
|
||||||
++nodeI;
|
}
|
||||||
} while (++i < 32);
|
*whichNode = i;
|
||||||
*whichNode = nodeI;
|
|
||||||
|
|
||||||
if (solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[BIOLOGICAL_SCAN])
|
if (solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[BIOLOGICAL_SCAN])
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -124,16 +124,13 @@ GenerateSupox_generateEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
|
|||||||
if (matchWorld (solarSys, world, 0, MATCH_PLANET))
|
if (matchWorld (solarSys, world, 0, MATCH_PLANET))
|
||||||
{
|
{
|
||||||
COUNT i;
|
COUNT i;
|
||||||
COUNT nodeI;
|
|
||||||
DWORD rand_val;
|
DWORD rand_val;
|
||||||
DWORD old_rand;
|
DWORD old_rand;
|
||||||
|
|
||||||
old_rand = TFB_SeedRandom (
|
old_rand = TFB_SeedRandom (
|
||||||
solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]);
|
solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]);
|
||||||
|
|
||||||
nodeI = 0;
|
for (i = 0; i < 16; ++i)
|
||||||
i = 0;
|
|
||||||
do
|
|
||||||
{
|
{
|
||||||
rand_val = TFB_Random ();
|
rand_val = TFB_Random ();
|
||||||
solarSys->SysInfo.PlanetInfo.CurPt.x =
|
solarSys->SysInfo.PlanetInfo.CurPt.x =
|
||||||
@@ -158,11 +155,10 @@ GenerateSupox_generateEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
|
|||||||
SET_GAME_STATE (ULTRON_CONDITION, 1);
|
SET_GAME_STATE (ULTRON_CONDITION, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (nodeI >= *whichNode)
|
if (i >= *whichNode)
|
||||||
break;
|
break;
|
||||||
++nodeI;
|
}
|
||||||
} while (++i < 16);
|
*whichNode = i;
|
||||||
*whichNode = nodeI;
|
|
||||||
|
|
||||||
TFB_SeedRandom (old_rand);
|
TFB_SeedRandom (old_rand);
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -165,14 +165,11 @@ GenerateThraddash_generateEnergy (SOLARSYS_STATE *solarSys,
|
|||||||
if (CurStarDescPtr->Index != AQUA_HELIX_DEFINED)
|
if (CurStarDescPtr->Index != AQUA_HELIX_DEFINED)
|
||||||
{
|
{
|
||||||
COUNT i;
|
COUNT i;
|
||||||
COUNT nodeI;
|
|
||||||
|
|
||||||
old_rand = TFB_SeedRandom (
|
old_rand = TFB_SeedRandom (
|
||||||
solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]);
|
solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]);
|
||||||
|
|
||||||
nodeI = 0;
|
for (i = 0; i < 16; ++i)
|
||||||
i = 0;
|
|
||||||
do
|
|
||||||
{
|
{
|
||||||
rand_val = TFB_Random ();
|
rand_val = TFB_Random ();
|
||||||
solarSys->SysInfo.PlanetInfo.CurPt.x =
|
solarSys->SysInfo.PlanetInfo.CurPt.x =
|
||||||
@@ -181,11 +178,10 @@ GenerateThraddash_generateEnergy (SOLARSYS_STATE *solarSys,
|
|||||||
(HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8;
|
(HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8;
|
||||||
solarSys->SysInfo.PlanetInfo.CurType = 1;
|
solarSys->SysInfo.PlanetInfo.CurType = 1;
|
||||||
solarSys->SysInfo.PlanetInfo.CurDensity = 0;
|
solarSys->SysInfo.PlanetInfo.CurDensity = 0;
|
||||||
if (nodeI >= *whichNode)
|
if (i >= *whichNode)
|
||||||
break;
|
break;
|
||||||
++nodeI;
|
}
|
||||||
} while (++i < 16);
|
*whichNode = i;
|
||||||
*whichNode = nodeI;
|
|
||||||
|
|
||||||
TFB_SeedRandom (old_rand);
|
TFB_SeedRandom (old_rand);
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -215,14 +215,11 @@ GenerateUtwig_generateEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
|
|||||||
&& matchWorld (solarSys, world, 0, MATCH_PLANET))
|
&& matchWorld (solarSys, world, 0, MATCH_PLANET))
|
||||||
{
|
{
|
||||||
COUNT i;
|
COUNT i;
|
||||||
COUNT nodeI;
|
|
||||||
|
|
||||||
old_rand = TFB_SeedRandom (
|
old_rand = TFB_SeedRandom (
|
||||||
solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]);
|
solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]);
|
||||||
|
|
||||||
nodeI = 0;
|
for (i = 0; i < 16; ++i)
|
||||||
i = 0;
|
|
||||||
do
|
|
||||||
{
|
{
|
||||||
rand_val = TFB_Random ();
|
rand_val = TFB_Random ();
|
||||||
solarSys->SysInfo.PlanetInfo.CurPt.x =
|
solarSys->SysInfo.PlanetInfo.CurPt.x =
|
||||||
@@ -231,11 +228,10 @@ GenerateUtwig_generateEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
|
|||||||
(HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8;
|
(HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8;
|
||||||
solarSys->SysInfo.PlanetInfo.CurType = 1;
|
solarSys->SysInfo.PlanetInfo.CurType = 1;
|
||||||
solarSys->SysInfo.PlanetInfo.CurDensity = 0;
|
solarSys->SysInfo.PlanetInfo.CurDensity = 0;
|
||||||
if (nodeI >= *whichNode)
|
if (i >= *whichNode)
|
||||||
break;
|
break;
|
||||||
++nodeI;
|
}
|
||||||
} while (++i < 16);
|
*whichNode = i;
|
||||||
*whichNode = nodeI;
|
|
||||||
|
|
||||||
TFB_SeedRandom (old_rand);
|
TFB_SeedRandom (old_rand);
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -238,16 +238,13 @@ GenerateVux_generateEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
|
|||||||
if (CurStarDescPtr->Index == VUX_DEFINED)
|
if (CurStarDescPtr->Index == VUX_DEFINED)
|
||||||
{
|
{
|
||||||
COUNT i;
|
COUNT i;
|
||||||
COUNT nodeI;
|
|
||||||
DWORD rand_val;
|
DWORD rand_val;
|
||||||
DWORD old_rand;
|
DWORD old_rand;
|
||||||
|
|
||||||
old_rand = TFB_SeedRandom (
|
old_rand = TFB_SeedRandom (
|
||||||
solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]);
|
solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]);
|
||||||
|
|
||||||
nodeI = 0;
|
for (i = 0; i < 16; ++i)
|
||||||
i = 0;
|
|
||||||
do
|
|
||||||
{
|
{
|
||||||
rand_val = TFB_Random ();
|
rand_val = TFB_Random ();
|
||||||
solarSys->SysInfo.PlanetInfo.CurPt.x =
|
solarSys->SysInfo.PlanetInfo.CurPt.x =
|
||||||
@@ -256,11 +253,10 @@ GenerateVux_generateEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
|
|||||||
(HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8;
|
(HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8;
|
||||||
solarSys->SysInfo.PlanetInfo.CurType = 1;
|
solarSys->SysInfo.PlanetInfo.CurType = 1;
|
||||||
solarSys->SysInfo.PlanetInfo.CurDensity = 0;
|
solarSys->SysInfo.PlanetInfo.CurDensity = 0;
|
||||||
if (nodeI >= *whichNode)
|
if (i >= *whichNode)
|
||||||
break;
|
break;
|
||||||
++nodeI;
|
}
|
||||||
} while (++i < 16);
|
*whichNode = i;
|
||||||
*whichNode = nodeI;
|
|
||||||
|
|
||||||
TFB_SeedRandom (old_rand);
|
TFB_SeedRandom (old_rand);
|
||||||
return true;
|
return true;
|
||||||
@@ -284,8 +280,7 @@ GenerateVux_generateLife (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
|
|||||||
old_rand = TFB_SeedRandom (
|
old_rand = TFB_SeedRandom (
|
||||||
solarSys->SysInfo.PlanetInfo.ScanSeed[BIOLOGICAL_SCAN]);
|
solarSys->SysInfo.PlanetInfo.ScanSeed[BIOLOGICAL_SCAN]);
|
||||||
|
|
||||||
i = 0;
|
for (i = 0; i < 12; ++i)
|
||||||
do
|
|
||||||
{
|
{
|
||||||
DWORD rand_val = TFB_Random ();
|
DWORD rand_val = TFB_Random ();
|
||||||
solarSys->SysInfo.PlanetInfo.CurPt.x =
|
solarSys->SysInfo.PlanetInfo.CurPt.x =
|
||||||
@@ -300,7 +295,7 @@ GenerateVux_generateLife (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
|
|||||||
solarSys->SysInfo.PlanetInfo.CurType = 18;
|
solarSys->SysInfo.PlanetInfo.CurType = 18;
|
||||||
if (i >= *whichNode)
|
if (i >= *whichNode)
|
||||||
break;
|
break;
|
||||||
} while (++i < 12);
|
}
|
||||||
*whichNode = i;
|
*whichNode = i;
|
||||||
|
|
||||||
TFB_SeedRandom (old_rand);
|
TFB_SeedRandom (old_rand);
|
||||||
@@ -316,8 +311,7 @@ GenerateVux_generateLife (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
|
|||||||
old_rand = TFB_SeedRandom (
|
old_rand = TFB_SeedRandom (
|
||||||
solarSys->SysInfo.PlanetInfo.ScanSeed[BIOLOGICAL_SCAN]);
|
solarSys->SysInfo.PlanetInfo.ScanSeed[BIOLOGICAL_SCAN]);
|
||||||
|
|
||||||
i = 0;
|
for (i = 0; i < 11; ++i)
|
||||||
do
|
|
||||||
{
|
{
|
||||||
DWORD rand_val = TFB_Random ();
|
DWORD rand_val = TFB_Random ();
|
||||||
solarSys->SysInfo.PlanetInfo.CurPt.x =
|
solarSys->SysInfo.PlanetInfo.CurPt.x =
|
||||||
@@ -347,7 +341,7 @@ GenerateVux_generateLife (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
|
|||||||
}
|
}
|
||||||
if (i >= *whichNode)
|
if (i >= *whichNode)
|
||||||
break;
|
break;
|
||||||
} while (++i < 11);
|
}
|
||||||
*whichNode = i;
|
*whichNode = i;
|
||||||
|
|
||||||
TFB_SeedRandom (old_rand);
|
TFB_SeedRandom (old_rand);
|
||||||
|
|||||||
@@ -114,16 +114,13 @@ GenerateYehat_generateEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
|
|||||||
if (matchWorld (solarSys, world, 0, MATCH_PLANET))
|
if (matchWorld (solarSys, world, 0, MATCH_PLANET))
|
||||||
{
|
{
|
||||||
COUNT i;
|
COUNT i;
|
||||||
COUNT nodeI;
|
|
||||||
DWORD rand_val;
|
DWORD rand_val;
|
||||||
DWORD old_rand;
|
DWORD old_rand;
|
||||||
|
|
||||||
old_rand = TFB_SeedRandom (
|
old_rand = TFB_SeedRandom (
|
||||||
solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]);
|
solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]);
|
||||||
|
|
||||||
nodeI = 0;
|
for (i = 0; i < 16; ++i)
|
||||||
i = 0;
|
|
||||||
do
|
|
||||||
{
|
{
|
||||||
rand_val = TFB_Random ();
|
rand_val = TFB_Random ();
|
||||||
solarSys->SysInfo.PlanetInfo.CurPt.x =
|
solarSys->SysInfo.PlanetInfo.CurPt.x =
|
||||||
@@ -132,11 +129,10 @@ GenerateYehat_generateEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
|
|||||||
(HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8;
|
(HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8;
|
||||||
solarSys->SysInfo.PlanetInfo.CurType = 1;
|
solarSys->SysInfo.PlanetInfo.CurType = 1;
|
||||||
solarSys->SysInfo.PlanetInfo.CurDensity = 0;
|
solarSys->SysInfo.PlanetInfo.CurDensity = 0;
|
||||||
if (nodeI >= *whichNode)
|
if (i >= *whichNode)
|
||||||
break;
|
break;
|
||||||
++nodeI;
|
}
|
||||||
} while (++i < 16);
|
*whichNode = i;
|
||||||
*whichNode = nodeI;
|
|
||||||
|
|
||||||
TFB_SeedRandom (old_rand);
|
TFB_SeedRandom (old_rand);
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -144,16 +144,13 @@ GenerateZoqFotPik_generateEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
|
|||||||
if (matchWorld (solarSys, world, 0, MATCH_PLANET))
|
if (matchWorld (solarSys, world, 0, MATCH_PLANET))
|
||||||
{
|
{
|
||||||
COUNT i;
|
COUNT i;
|
||||||
COUNT nodeI;
|
|
||||||
DWORD rand_val;
|
DWORD rand_val;
|
||||||
DWORD old_rand;
|
DWORD old_rand;
|
||||||
|
|
||||||
old_rand = TFB_SeedRandom (
|
old_rand = TFB_SeedRandom (
|
||||||
solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]);
|
solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]);
|
||||||
|
|
||||||
nodeI = 0;
|
for (i = 0; i < 16; ++i)
|
||||||
i = 0;
|
|
||||||
do
|
|
||||||
{
|
{
|
||||||
rand_val = TFB_Random ();
|
rand_val = TFB_Random ();
|
||||||
solarSys->SysInfo.PlanetInfo.CurPt.x =
|
solarSys->SysInfo.PlanetInfo.CurPt.x =
|
||||||
@@ -162,11 +159,10 @@ GenerateZoqFotPik_generateEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
|
|||||||
(HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8;
|
(HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8;
|
||||||
solarSys->SysInfo.PlanetInfo.CurType = 1;
|
solarSys->SysInfo.PlanetInfo.CurType = 1;
|
||||||
solarSys->SysInfo.PlanetInfo.CurDensity = 0;
|
solarSys->SysInfo.PlanetInfo.CurDensity = 0;
|
||||||
if (nodeI >= *whichNode)
|
if (i >= *whichNode)
|
||||||
break;
|
break;
|
||||||
++nodeI;
|
}
|
||||||
} while (++i < 16);
|
*whichNode = i;
|
||||||
*whichNode = nodeI;
|
|
||||||
|
|
||||||
TFB_SeedRandom (old_rand);
|
TFB_SeedRandom (old_rand);
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user