From 6327d63e25aadf391cdd166d3dc22d692cafdb63 Mon Sep 17 00:00:00 2001 From: "cedeel@gmail.com" Date: Thu, 14 Jun 2012 23:25:26 +0000 Subject: Only spawn nether mobs in nether biome. git-svn-id: http://mc-server.googlecode.com/svn/trunk@613 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cWorld.cpp | 46 ++++++++++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/source/cWorld.cpp b/source/cWorld.cpp index 48fb3a3ad..82243a8a9 100644 --- a/source/cWorld.cpp +++ b/source/cWorld.cpp @@ -747,26 +747,32 @@ void cWorld::TickSpawnMobs(float a_Dt) if (m_WorldTime >= 12000 + 1000) { - if (nightRand == 0) //random percent to spawn for night - Monster = new cSpider(); - else if (nightRand == 1) - Monster = new cZombie(); - else if (nightRand == 2) - Monster = new cEnderman(); - else if (nightRand == 3) - Monster = new cCreeper(); - else if (nightRand == 4) - Monster = new cCavespider(); - else if (nightRand == 5) - Monster = new cGhast(); - else if (nightRand == 6) - Monster = new cZombiepigman(); - else if (nightRand == 7) - Monster = new cSlime(); - else if (nightRand == 8) - Monster = new cSilverfish(); - else if (nightRand == 9) - Monster = new cSkeleton(); + if (GetBiomeAt(SpawnPos.x, SpawnPos.z) == biHell) // Spawn nether mobs + { + if (nightRand == 1 && GetBiomeAt(SpawnPos.x, SpawnPos.z) == biHell) + Monster = new cZombie(); + else if (nightRand == 5) + Monster = new cGhast(); + else if (nightRand == 6) + Monster = new cZombiepigman(); + } + else + { + if (nightRand == 0) //random percent to spawn for night + Monster = new cSpider(); + else if (nightRand == 2) + Monster = new cEnderman(); + else if (nightRand == 3) + Monster = new cCreeper(); + else if (nightRand == 4) + Monster = new cCavespider(); + else if (nightRand == 7) + Monster = new cSlime(); + else if (nightRand == 8) + Monster = new cSilverfish(); + else if (nightRand == 9) + Monster = new cSkeleton(); + } //end random percent to spawn for night } else -- cgit v1.2.3