Removed a moot test for node retrieval status from generation funcs (never called this way for retrieved nodes); some readability { }

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3579 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
avolkov
2011-04-21 00:18:18 +00:00
parent 55b6245500
commit 396f280130
17 changed files with 39 additions and 59 deletions
+1 -3
View File
@@ -167,9 +167,7 @@ GenerateAndrosynth_generateEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
}
}
if (nodeI >= *whichNode
&& !(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN]
& (1L << i)))
if (nodeI >= *whichNode)
break;
++nodeI;
} while (++i < 16);
+3 -3
View File
@@ -160,9 +160,7 @@ GenerateBurvixese_generateEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
(HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8;
solarSys->SysInfo.PlanetInfo.CurType = 1;
solarSys->SysInfo.PlanetInfo.CurDensity = 0;
if (nodeI >= *whichNode
&& !(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN]
& (1L << i)))
if (nodeI >= *whichNode)
break;
++nodeI;
} while (++i < 16);
@@ -188,7 +186,9 @@ GenerateBurvixese_generateEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
if (!(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN]
& (1L << 0))
&& *whichNode == (COUNT)~0)
{
*whichNode = 1;
}
else
{
*whichNode = 0;
+1 -3
View File
@@ -166,9 +166,7 @@ GenerateDruuge_generateEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
SET_GAME_STATE (ROSY_SPHERE_ON_SHIP, 1);
}
}
if (nodeI >= *whichNode
&& !(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN]
& (1L << i)))
if (nodeI >= *whichNode)
break;
++nodeI;
} while (++i < 16);
+1 -3
View File
@@ -142,9 +142,7 @@ GenerateIlwrath_generateEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
(HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8;
solarSys->SysInfo.PlanetInfo.CurType = 1;
solarSys->SysInfo.PlanetInfo.CurDensity = 0;
if (nodeI >= *whichNode
&& !(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN]
& (1L << i)))
if (nodeI >= *whichNode)
break;
++nodeI;
} while (++i < 16);
+6
View File
@@ -205,7 +205,9 @@ GenerateMycon_generateEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
if (!(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN]
& (1L << 0))
&& *whichNode == (COUNT)~0)
{
*whichNode = 1;
}
else
{
*whichNode = 0;
@@ -223,10 +225,14 @@ GenerateMycon_generateEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
if (!(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN]
& (1L << 0))
&& *whichNode == (COUNT)~0)
{
*whichNode = 1;
}
else
{
*whichNode = 0;
// XXX: Why does this also test the PlanetInfo.DiscoveryString?
// No other similar code ever tests the DiscoveryString.
if ((solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN]
& (1L << 0))
&& solarSys->SysInfo.PlanetInfo.DiscoveryString)
+3 -3
View File
@@ -184,7 +184,9 @@ GenerateOrz_generateEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
if (!(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN]
& (1L << 0))
&& *whichNode == (COUNT)~0)
{
*whichNode = 1;
}
else
{
*whichNode = 0;
@@ -221,9 +223,7 @@ GenerateOrz_generateEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
(HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8;
solarSys->SysInfo.PlanetInfo.CurType = 1;
solarSys->SysInfo.PlanetInfo.CurDensity = 0;
if (nodeI >= *whichNode &&
!(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN]
& (1L << i)))
if (nodeI >= *whichNode)
break;
++nodeI;
} while (++i < 16);
+1 -3
View File
@@ -179,9 +179,7 @@ GenerateTalkingPet_generateEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
(HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8;
solarSys->SysInfo.PlanetInfo.CurType = 1;
solarSys->SysInfo.PlanetInfo.CurDensity = 0;
if (nodeI >= *whichNode
&& !(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN]
& (1L << i)))
if (nodeI >= *whichNode)
break;
++nodeI;
} while (++i < 16);
+1 -3
View File
@@ -156,9 +156,7 @@ GeneratePkunk_generateEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
SET_GAME_STATE (CLEAR_SPINDLE_ON_SHIP, 1);
}
}
if (nodeI >= *whichNode
&& !(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN]
& (1L << i)))
if (nodeI >= *whichNode)
break;
++nodeI;
} while (++i < 16);
+1 -3
View File
@@ -593,9 +593,7 @@ GenerateSol_generateLife (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
solarSys->SysInfo.PlanetInfo.CurPt.y =
(HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8;
solarSys->SysInfo.PlanetInfo.CurType = NUM_CREATURE_TYPES + 1;
if (nodeI >= *whichNode
&& !(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[BIOLOGICAL_SCAN]
& (1L << i)))
if (nodeI >= *whichNode)
break;
++nodeI;
} while (++i < 10);
+3 -3
View File
@@ -212,7 +212,9 @@ GenerateSpathi_generateEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
if (!(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN]
& (1L << 0))
&& *whichNode == (COUNT)~0)
{
*whichNode = 1;
}
else
{
*whichNode = 0;
@@ -256,9 +258,7 @@ GenerateSpathi_generateLife (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
solarSys->SysInfo.PlanetInfo.CurPt.y =
(HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8;
solarSys->SysInfo.PlanetInfo.CurType = NUM_CREATURE_TYPES;
if (nodeI >= *whichNode
&& !(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[BIOLOGICAL_SCAN]
& (1L << i)))
if (nodeI >= *whichNode)
break;
++nodeI;
} while (++i < 32);
+1 -3
View File
@@ -158,9 +158,7 @@ GenerateSupox_generateEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
SET_GAME_STATE (ULTRON_CONDITION, 1);
}
}
if (nodeI >= *whichNode
&& !(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN]
& (1L << i)))
if (nodeI >= *whichNode)
break;
++nodeI;
} while (++i < 16);
+3 -3
View File
@@ -181,9 +181,7 @@ GenerateThraddash_generateEnergy (SOLARSYS_STATE *solarSys,
(HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8;
solarSys->SysInfo.PlanetInfo.CurType = 1;
solarSys->SysInfo.PlanetInfo.CurDensity = 0;
if (nodeI >= *whichNode
&& !(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN]
& (1L << i)))
if (nodeI >= *whichNode)
break;
++nodeI;
} while (++i < 16);
@@ -207,7 +205,9 @@ GenerateThraddash_generateEnergy (SOLARSYS_STATE *solarSys,
solarSys->SysInfo.PlanetInfo.CurType = 0;
if (!(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN]
& (1L << 0)) && *whichNode == (COUNT)~0)
{
*whichNode = 1;
}
else
{
*whichNode = 0;
+3 -3
View File
@@ -231,9 +231,7 @@ GenerateUtwig_generateEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
(HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8;
solarSys->SysInfo.PlanetInfo.CurType = 1;
solarSys->SysInfo.PlanetInfo.CurDensity = 0;
if (nodeI >= *whichNode
&& !(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN]
& (1L << i)))
if (nodeI >= *whichNode)
break;
++nodeI;
} while (++i < 16);
@@ -260,7 +258,9 @@ GenerateUtwig_generateEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
if (!(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN]
& (1L << 0))
&& *whichNode == (COUNT)~0)
{
*whichNode = 1;
}
else
{
*whichNode = 0;
+7 -11
View File
@@ -219,7 +219,9 @@ GenerateVux_generateEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
if (!(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN]
& (1L << 0))
&& *whichNode == (COUNT)~0)
{
*whichNode = 1;
}
else
{
*whichNode = 0;
@@ -254,9 +256,7 @@ GenerateVux_generateEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
(HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8;
solarSys->SysInfo.PlanetInfo.CurType = 1;
solarSys->SysInfo.PlanetInfo.CurDensity = 0;
if (nodeI >= *whichNode
&& !(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN]
& (1L << i)))
if (nodeI >= *whichNode)
break;
++nodeI;
} while (++i < 16);
@@ -298,9 +298,7 @@ GenerateVux_generateLife (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
solarSys->SysInfo.PlanetInfo.CurType = 14;
else /* if (i < 12) */
solarSys->SysInfo.PlanetInfo.CurType = 18;
if (i >= *whichNode
&& !(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[BIOLOGICAL_SCAN]
& (1L << i)))
if (i >= *whichNode)
break;
} while (++i < 12);
*whichNode = i;
@@ -334,11 +332,7 @@ GenerateVux_generateLife (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
else /* if (i <= 10) */
/* {BEHAVIOR_UNPREDICTABLE | SPEED_SLOW | DANGER_NORMAL, MAKE_BYTE (3, 8)}, */
solarSys->SysInfo.PlanetInfo.CurType = 8;
if (i >= *whichNode
&& !(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[BIOLOGICAL_SCAN]
& (1L << i)))
break;
else if (i == 0
if (i == 0
&& (solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[BIOLOGICAL_SCAN]
& (1L << i))
&& !GET_GAME_STATE (VUX_BEAST))
@@ -351,6 +345,8 @@ GenerateVux_generateLife (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
SET_GAME_STATE (VUX_BEAST, 1);
SET_GAME_STATE (VUX_BEAST_ON_SHIP, 1);
}
if (i >= *whichNode)
break;
} while (++i < 11);
*whichNode = i;
+1 -3
View File
@@ -132,9 +132,7 @@ GenerateYehat_generateEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
(HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8;
solarSys->SysInfo.PlanetInfo.CurType = 1;
solarSys->SysInfo.PlanetInfo.CurDensity = 0;
if (nodeI >= *whichNode
&& !(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN]
& (1L << i)))
if (nodeI >= *whichNode)
break;
++nodeI;
} while (++i < 16);
+1 -3
View File
@@ -162,9 +162,7 @@ GenerateZoqFotPik_generateEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
(HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8;
solarSys->SysInfo.PlanetInfo.CurType = 1;
solarSys->SysInfo.PlanetInfo.CurDensity = 0;
if (nodeI >= *whichNode
&& !(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN]
& (1L << i)))
if (nodeI >= *whichNode)
break;
++nodeI;
} while (++i < 16);
+2 -6
View File
@@ -82,9 +82,7 @@ CalcMineralDeposits (SYSTEM_INFO *SysInfoPtr, COUNT which_deposit)
SysInfoPtr->PlanetInfo.CurDensity,
Elements[eptr->ElementType].name);
#endif /* DEBUG_SURFACE */
if ((num_deposits >= which_deposit
&& !(SysInfoPtr->PlanetInfo.ScanRetrieveMask[MINERAL_SCAN]
& (1L << num_deposits)))
if (num_deposits >= which_deposit
|| ++num_deposits == sizeof (DWORD) * 8)
goto ExitCalcMinerals;
}
@@ -228,9 +226,7 @@ CalcLifeForms (SYSTEM_INFO *SysInfoPtr, COUNT which_life)
(HIBYTE (rand_val) % (MAP_HEIGHT - (8 << 1))) + 8;
SysInfoPtr->PlanetInfo.CurType = index;
if ((num_life_forms >= which_life
&& !(SysInfoPtr->PlanetInfo.ScanRetrieveMask[BIOLOGICAL_SCAN]
& (1L << num_life_forms)))
if (num_life_forms >= which_life
|| ++num_life_forms == sizeof (DWORD) * 8)
{
num_types = 1;