Skip to content

Commit

Permalink
Suggestions by xoft
Browse files Browse the repository at this point in the history
Using IntNoise3D to prevent needless floating point math
  • Loading branch information
NiLSPACE committed Dec 2, 2014
1 parent 7586069 commit 5db3ceb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Generating/DungeonRoomsFinisher.cpp
Expand Up @@ -61,12 +61,12 @@ class cDungeonRoom :

// Choose what the mobspawner will spawn.
// 25% chance for a spider, 25% for a skeleton and 50% chance to get a zombie spawer.
NOISE_DATATYPE MobType = a_Noise.IntNoise3D(a_OriginX, m_FloorHeight, a_OriginZ);
if (MobType <= -0.5)
int MobType = (a_Noise.IntNoise3D(a_OriginX, m_FloorHeight, a_OriginZ) / 7) % 100
if (MobType <= 25)
{
m_MonsterType = mtSkeleton;
}
else if (MobType <= 0)
else if (MobType <= 50)
{
m_MonsterType = mtSpider;
}
Expand Down

0 comments on commit 5db3ceb

Please sign in to comment.