summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authormgueydan <gueydan.mathieuÃ@gmail.com>2013-09-08 12:20:19 +0200
committermgueydan <gueydan.mathieuÃ@gmail.com>2013-09-08 12:20:19 +0200
commit5846be9400d26d198ddc3884a8e02c405748c6ad (patch)
tree86fc53b2a3149d4c8b775c3110f541be0a35cfe4 /source
parentremoving an assert + correcting a distance calculation bug (diff)
downloadcuberite-5846be9400d26d198ddc3884a8e02c405748c6ad.tar
cuberite-5846be9400d26d198ddc3884a8e02c405748c6ad.tar.gz
cuberite-5846be9400d26d198ddc3884a8e02c405748c6ad.tar.bz2
cuberite-5846be9400d26d198ddc3884a8e02c405748c6ad.tar.lz
cuberite-5846be9400d26d198ddc3884a8e02c405748c6ad.tar.xz
cuberite-5846be9400d26d198ddc3884a8e02c405748c6ad.tar.zst
cuberite-5846be9400d26d198ddc3884a8e02c405748c6ad.zip
Diffstat (limited to 'source')
-rw-r--r--source/Chunk.cpp6
-rw-r--r--source/MobProximityCounter.cpp2
-rw-r--r--source/MobTypesManager.cpp8
3 files changed, 10 insertions, 6 deletions
diff --git a/source/Chunk.cpp b/source/Chunk.cpp
index a77f10609..01cb13c4d 100644
--- a/source/Chunk.cpp
+++ b/source/Chunk.cpp
@@ -471,7 +471,7 @@ void cChunk::CollectMobCensus(cMobCensus& toFill)
void cChunk::getThreeRandomNumber(int& a_X, int& a_Y, int& a_Z,int a_MaxX, int a_MaxY, int a_MaxZ)
{
- assert(a_MaxX * a_MaxY * a_MaxZ * 8 < 0x00ffffff);
+ ASSERT(a_MaxX * a_MaxY * a_MaxZ * 8 < 0x00ffffff);
int Random = m_World->GetTickRandomNumber(0x00ffffff);
a_X = Random % (a_MaxX * 2);
a_Y = (Random / (a_MaxX * 2)) % (a_MaxY * 2);
@@ -523,8 +523,8 @@ void cChunk::SpawnMobs(cMobSpawner& a_MobSpawner)
Try_Y += Center_Y;
Try_Z += Center_Z;
- assert(Try_Y > 0);
- assert(Try_Y < cChunkDef::Height-1);
+ ASSERT(Try_Y > 0);
+ ASSERT(Try_Y < cChunkDef::Height-1);
BLOCKTYPE BlockType;
NIBBLETYPE BlockMeta;
diff --git a/source/MobProximityCounter.cpp b/source/MobProximityCounter.cpp
index e0b7f34cb..3c5ec9153 100644
--- a/source/MobProximityCounter.cpp
+++ b/source/MobProximityCounter.cpp
@@ -16,7 +16,7 @@ void cMobProximityCounter::CollectMob(cEntity& a_Monster, cChunk& a_Chunk, doubl
std::pair<tMonsterToDistance::iterator,bool> result = m_MonsterToDistance.insert(tMonsterToDistance::value_type(&a_Monster,newDistanceAndChunck));
if (!result.second)
{
- ASSERT("A collected Monster was not found inside distance map using find(), but insert() said there already is a key for it");
+ ASSERT(!"A collected Monster was not found inside distance map using find(), but insert() said there already is a key for it");
}
}
else
diff --git a/source/MobTypesManager.cpp b/source/MobTypesManager.cpp
index 0c13e5aea..2d24bd39b 100644
--- a/source/MobTypesManager.cpp
+++ b/source/MobTypesManager.cpp
@@ -102,7 +102,11 @@ cMonster* cMobTypesManager::NewMonsterFromType(cMonster::eType a_MobType, int a_
{
a_Size = m_Random().NextInt(2,a_MobType)+1;
}
- assert(a_Size > 0 && a_Size < 4);
+ if (a_Size <= 0 || a_Size >= 4)
+ {
+ ASSERT(!"Random for size was supposed to pick in [1..3] and picked outside");
+ a_Size = 1;
+ }
break;
default : break;
}
@@ -135,7 +139,7 @@ cMonster* cMobTypesManager::NewMonsterFromType(cMonster::eType a_MobType, int a_
case cMonster::mtZombiePigman: toReturn = new cZombiepigman(); break;
default:
{
- assert(false);
+ ASSERT(!"Unhandled Mob type");
}
}
return toReturn;