1
0

class description and doxy-commenting

This commit is contained in:
p-mcgowan 2014-12-03 00:12:32 -08:00
parent d348433406
commit 8c3b9ae15b
2 changed files with 8 additions and 5 deletions

View File

@ -1001,7 +1001,7 @@ void cFinishGenPassiveMobs::GenFinish(cChunkDesc & a_ChunkDesc)
return; return;
} }
// Try spawning a pack center 10 times, should get roughly the same probability /** Try spawning a pack center 10 times, should get roughly the same probability */
for (int Tries = 0; Tries < 10; Tries++) for (int Tries = 0; Tries < 10; Tries++)
{ {
int PackCenterX = (m_Noise.IntNoise2DInt(chunkX, chunkZ) / 7) % cChunkDef::Width; int PackCenterX = (m_Noise.IntNoise2DInt(chunkX, chunkZ) / 7) % cChunkDef::Width;
@ -1030,7 +1030,7 @@ bool cFinishGenPassiveMobs::TrySpawnAnimals(cChunkDesc & a_ChunkDesc, int a_RelX
BLOCKTYPE BlockAtFeet = a_ChunkDesc.GetBlockType(a_RelX, a_RelY, a_RelZ); BLOCKTYPE BlockAtFeet = a_ChunkDesc.GetBlockType(a_RelX, a_RelY, a_RelZ);
BLOCKTYPE BlockUnderFeet = a_ChunkDesc.GetBlockType(a_RelX, a_RelY - 1, a_RelZ); BLOCKTYPE BlockUnderFeet = a_ChunkDesc.GetBlockType(a_RelX, a_RelY - 1, a_RelZ);
// Check block below (opaque, grass, water), and above (air) /** Check block below (opaque, grass, water), and above (air) */
if (AnimalToSpawn == mtSquid && BlockAtFeet != E_BLOCK_WATER) if (AnimalToSpawn == mtSquid && BlockAtFeet != E_BLOCK_WATER)
{ {
return false; return false;
@ -1081,7 +1081,7 @@ eMonsterType cFinishGenPassiveMobs::GetRandomMob(cChunkDesc & a_ChunkDesc)
int x = (m_Noise.IntNoise2DInt(chunkX, chunkZ) / 7) % cChunkDef::Width; int x = (m_Noise.IntNoise2DInt(chunkX, chunkZ) / 7) % cChunkDef::Width;
int z = (m_Noise.IntNoise2DInt(chunkX, chunkZ) / 7) % cChunkDef::Width; int z = (m_Noise.IntNoise2DInt(chunkX, chunkZ) / 7) % cChunkDef::Width;
// Check biomes first to get a list of animals /** Check biomes first to get a list of animals */
switch (a_ChunkDesc.GetBiome(x, z)) switch (a_ChunkDesc.GetBiome(x, z))
{ {
// No animals // No animals

View File

@ -318,6 +318,9 @@ protected:
/** This class populates generated chunks with packs of biome-dependant animals
Animals: cows, sheep, pigs, mooshrooms, squid, horses, wolves, ocelots
*/
class cFinishGenPassiveMobs : class cFinishGenPassiveMobs :
public cFinishGen public cFinishGen
{ {
@ -328,9 +331,9 @@ public:
protected: protected:
cNoise m_Noise; cNoise m_Noise;
int m_AnimalProbability; // Chance, [0..100], that an animal pack will be generated in a chunk int m_AnimalProbability; /** Chance, [0..100], that an animal pack will be generated in a chunk */
// cFinishGen override: /** cFinishGen override: */
virtual void GenFinish(cChunkDesc & a_ChunkDesc) override; virtual void GenFinish(cChunkDesc & a_ChunkDesc) override;
/** Tries to spawn a mob in the center of the pack. If successful, spawns 0-5 more. */ /** Tries to spawn a mob in the center of the pack. If successful, spawns 0-5 more. */