summaryrefslogtreecommitdiffstats
path: root/src/BlockEntities/MobSpawnerEntity.cpp
diff options
context:
space:
mode:
authorJulian Laubstein <julianlaubstein@yahoo.de>2015-05-29 11:08:32 +0200
committerJulian Laubstein <julianlaubstein@yahoo.de>2015-05-29 11:08:32 +0200
commit1e6f02437e88495d57249f742526526ee5865777 (patch)
treeaf200ec3c23c5d04359ba471d275cfa6d0a3c7fb /src/BlockEntities/MobSpawnerEntity.cpp
parentMerge pull request #2157 from beeduck/Issue2106 (diff)
parentMerge branch 'master' into PreventNewWarnings (diff)
downloadcuberite-1e6f02437e88495d57249f742526526ee5865777.tar
cuberite-1e6f02437e88495d57249f742526526ee5865777.tar.gz
cuberite-1e6f02437e88495d57249f742526526ee5865777.tar.bz2
cuberite-1e6f02437e88495d57249f742526526ee5865777.tar.lz
cuberite-1e6f02437e88495d57249f742526526ee5865777.tar.xz
cuberite-1e6f02437e88495d57249f742526526ee5865777.tar.zst
cuberite-1e6f02437e88495d57249f742526526ee5865777.zip
Diffstat (limited to 'src/BlockEntities/MobSpawnerEntity.cpp')
-rw-r--r--src/BlockEntities/MobSpawnerEntity.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/BlockEntities/MobSpawnerEntity.cpp b/src/BlockEntities/MobSpawnerEntity.cpp
index 764d7af84..1a0ce5b22 100644
--- a/src/BlockEntities/MobSpawnerEntity.cpp
+++ b/src/BlockEntities/MobSpawnerEntity.cpp
@@ -145,9 +145,9 @@ void cMobSpawnerEntity::SpawnEntity(void)
break;
}
- int RelX = (int) (m_RelX + (double)(Random.NextFloat() - Random.NextFloat()) * 4.0);
+ int RelX = static_cast<int>(m_RelX + static_cast<double>(Random.NextFloat() - Random.NextFloat()) * 4.0);
int RelY = m_RelY + Random.NextInt(3) - 1;
- int RelZ = (int) (m_RelZ + (double)(Random.NextFloat() - Random.NextFloat()) * 4.0);
+ int RelZ = static_cast<int>(m_RelZ + static_cast<double>(Random.NextFloat() - Random.NextFloat()) * 4.0);
cChunk * Chunk = a_Chunk->GetRelNeighborChunkAdjustCoords(RelX, RelZ);
if ((Chunk == nullptr) || !Chunk->IsValid())
@@ -172,7 +172,13 @@ void cMobSpawnerEntity::SpawnEntity(void)
if (Chunk->GetWorld()->SpawnMobFinalize(Monster) != cEntity::INVALID_ID)
{
EntitiesSpawned = true;
- Chunk->BroadcastSoundParticleEffect(2004, (int)(PosX * 8.0), (int)(RelY * 8.0), (int)(PosZ * 8.0), 0);
+ Chunk->BroadcastSoundParticleEffect(
+ 2004,
+ static_cast<int>(PosX * 8.0),
+ static_cast<int>(RelY * 8.0),
+ static_cast<int>(PosZ * 8.0),
+ 0
+ );
m_NearbyEntitiesNum++;
}
}
@@ -246,9 +252,9 @@ int cMobSpawnerEntity::GetNearbyMonsterNum(eMonsterType a_EntityType)
class cCallback : public cChunkDataCallback
{
public:
- cCallback(Vector3d a_SpawnerPos, eMonsterType a_EntityType, int & a_NumEntities) :
+ cCallback(Vector3d a_SpawnerPos, eMonsterType a_CallbackEntityType, int & a_NumEntities) :
m_SpawnerPos(a_SpawnerPos),
- m_EntityType(a_EntityType),
+ m_EntityType(a_CallbackEntityType),
m_NumEntities(a_NumEntities)
{
}
@@ -260,7 +266,7 @@ int cMobSpawnerEntity::GetNearbyMonsterNum(eMonsterType a_EntityType)
return;
}
- cMonster * Mob = (cMonster *)a_Entity;
+ cMonster * Mob = static_cast<cMonster *>(a_Entity);
if (Mob->GetMobType() != m_EntityType)
{
return;