summaryrefslogtreecommitdiffstats
path: root/src/BlockEntities/MobSpawnerEntity.cpp
diff options
context:
space:
mode:
authortycho <work.tycho@gmail.com>2015-05-24 13:56:56 +0200
committertycho <work.tycho@gmail.com>2015-05-24 13:56:56 +0200
commitdae9e5792a4f030ae9e748548a16a89790fbd311 (patch)
tree2142b8c4deb9f2c7ad096b8b0ec93fefccd8d8f1 /src/BlockEntities/MobSpawnerEntity.cpp
parentMerge branch 'master' into PreventNewWarnings (diff)
downloadcuberite-dae9e5792a4f030ae9e748548a16a89790fbd311.tar
cuberite-dae9e5792a4f030ae9e748548a16a89790fbd311.tar.gz
cuberite-dae9e5792a4f030ae9e748548a16a89790fbd311.tar.bz2
cuberite-dae9e5792a4f030ae9e748548a16a89790fbd311.tar.lz
cuberite-dae9e5792a4f030ae9e748548a16a89790fbd311.tar.xz
cuberite-dae9e5792a4f030ae9e748548a16a89790fbd311.tar.zst
cuberite-dae9e5792a4f030ae9e748548a16a89790fbd311.zip
Diffstat (limited to '')
-rw-r--r--src/BlockEntities/MobSpawnerEntity.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/BlockEntities/MobSpawnerEntity.cpp b/src/BlockEntities/MobSpawnerEntity.cpp
index f8222822c..4746bdd1b 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,12 @@ 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++;
}
}
@@ -260,7 +265,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;