1
0

Suggestions by xoft

Using IntNoise3D to prevent needless floating point math
This commit is contained in:
STRWarrior 2014-12-02 09:42:49 +01:00
parent 7586069829
commit 5db3ceb333

View File

@ -61,12 +61,12 @@ public:
// 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;
}