From dae9e5792a4f030ae9e748548a16a89790fbd311 Mon Sep 17 00:00:00 2001 From: tycho Date: Sun, 24 May 2015 12:56:56 +0100 Subject: Made -Weverything an error. --- src/BlockEntities/MobSpawnerEntity.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/BlockEntities/MobSpawnerEntity.cpp') 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(m_RelX + static_cast(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(m_RelZ + static_cast(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(PosX * 8.0), + static_cast(RelY * 8.0), + static_cast(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(a_Entity); if (Mob->GetMobType() != m_EntityType) { return; -- cgit v1.2.3