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/LineBlockTracer.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/LineBlockTracer.cpp') diff --git a/src/LineBlockTracer.cpp b/src/LineBlockTracer.cpp index e43a79566..ee28bef88 100644 --- a/src/LineBlockTracer.cpp +++ b/src/LineBlockTracer.cpp @@ -96,17 +96,17 @@ bool cLineBlockTracer::Trace(double a_StartX, double a_StartY, double a_StartZ, m_Callbacks->OnIntoWorld(m_StartX, m_StartY, m_StartZ); } - m_CurrentX = (int)floor(m_StartX); - m_CurrentY = (int)floor(m_StartY); - m_CurrentZ = (int)floor(m_StartZ); + m_CurrentX = static_cast(floor(m_StartX)); + m_CurrentY = static_cast(floor(m_StartY)); + m_CurrentZ = static_cast(floor(m_StartZ)); m_DiffX = m_EndX - m_StartX; m_DiffY = m_EndY - m_StartY; m_DiffZ = m_EndZ - m_StartZ; // The actual trace is handled with ChunkMapCS locked by calling our Item() for the specified chunk - int BlockX = (int)floor(m_StartX); - int BlockZ = (int)floor(m_StartZ); + int BlockX = static_cast(floor(m_StartX)); + int BlockZ = static_cast(floor(m_StartZ)); int ChunkX, ChunkZ; cChunkDef::BlockToChunk(BlockX, BlockZ, ChunkX, ChunkZ); return m_World->DoWithChunk(ChunkX, ChunkZ, *this); @@ -120,7 +120,7 @@ void cLineBlockTracer::FixStartAboveWorld(void) { // We must set the start Y to less than cChunkDef::Height so that it is considered inside the world later on // Therefore we use an EPS-offset from the height, as small as reasonably possible. - const double Height = (double)cChunkDef::Height - 0.00001; + const double Height = static_cast(cChunkDef::Height) - 0.00001; CalcXZIntersection(Height, m_StartX, m_StartZ); m_StartY = Height; } -- cgit v1.2.3 From b2fa71a32ac8bd86bda778a5d54fe2e7e471a1c0 Mon Sep 17 00:00:00 2001 From: tycho Date: Thu, 28 May 2015 12:29:26 +0100 Subject: Fix comments --- src/LineBlockTracer.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/LineBlockTracer.cpp') diff --git a/src/LineBlockTracer.cpp b/src/LineBlockTracer.cpp index ee28bef88..315e8d082 100644 --- a/src/LineBlockTracer.cpp +++ b/src/LineBlockTracer.cpp @@ -96,17 +96,17 @@ bool cLineBlockTracer::Trace(double a_StartX, double a_StartY, double a_StartZ, m_Callbacks->OnIntoWorld(m_StartX, m_StartY, m_StartZ); } - m_CurrentX = static_cast(floor(m_StartX)); - m_CurrentY = static_cast(floor(m_StartY)); - m_CurrentZ = static_cast(floor(m_StartZ)); + m_CurrentX = FloorC(m_StartX); + m_CurrentY = FloorC(m_StartY); + m_CurrentZ = FloorC(m_StartZ); m_DiffX = m_EndX - m_StartX; m_DiffY = m_EndY - m_StartY; m_DiffZ = m_EndZ - m_StartZ; // The actual trace is handled with ChunkMapCS locked by calling our Item() for the specified chunk - int BlockX = static_cast(floor(m_StartX)); - int BlockZ = static_cast(floor(m_StartZ)); + int BlockX = FloorC(m_StartX); + int BlockZ = FloorC(m_StartZ); int ChunkX, ChunkZ; cChunkDef::BlockToChunk(BlockX, BlockZ, ChunkX, ChunkZ); return m_World->DoWithChunk(ChunkX, ChunkZ, *this); -- cgit v1.2.3