1
0

Fixed some Visual Studio warnings

This commit is contained in:
Tiger Wang
2015-05-08 23:32:02 +01:00
parent 9329c2c2cb
commit 218010cd96
8 changed files with 38 additions and 25 deletions

View File

@@ -261,11 +261,11 @@ void cMonster::MoveToWayPoint(cChunk & a_Chunk)
bool cMonster::EnsureProperDestination(cChunk & a_Chunk)
{
cChunk * Chunk = a_Chunk.GetNeighborChunk(m_FinalDestination.x, m_FinalDestination.z);
cChunk * Chunk = a_Chunk.GetNeighborChunk(FloorC(m_FinalDestination.x), FloorC(m_FinalDestination.z));
BLOCKTYPE BlockType;
NIBBLETYPE BlockMeta;
int RelX = m_FinalDestination.x - Chunk->GetPosX() * cChunkDef::Width;
int RelZ = m_FinalDestination.z - Chunk->GetPosZ() * cChunkDef::Width;
int RelX = FloorC(m_FinalDestination.x) - Chunk->GetPosX() * cChunkDef::Width;
int RelZ = FloorC(m_FinalDestination.z) - Chunk->GetPosZ() * cChunkDef::Width;
if ((Chunk == nullptr) || !Chunk->IsValid())
{
return false;
@@ -274,7 +274,7 @@ bool cMonster::EnsureProperDestination(cChunk & a_Chunk)
// If destination in the air, go down to the lowest air block.
while (m_FinalDestination.y > 0)
{
Chunk->GetBlockTypeMeta(RelX, m_FinalDestination.y - 1, RelZ, BlockType, BlockMeta);
Chunk->GetBlockTypeMeta(RelX, FloorC(m_FinalDestination.y) - 1, RelZ, BlockType, BlockMeta);
if (cBlockInfo::IsSolid(BlockType))
{
break;
@@ -288,7 +288,7 @@ bool cMonster::EnsureProperDestination(cChunk & a_Chunk)
bool InWater = false;
while (m_FinalDestination.y < cChunkDef::Height)
{
Chunk->GetBlockTypeMeta(RelX, m_FinalDestination.y, RelZ, BlockType, BlockMeta);
Chunk->GetBlockTypeMeta(RelX, FloorC(m_FinalDestination.y), RelZ, BlockType, BlockMeta);
if (BlockType == E_BLOCK_STATIONARY_WATER)
{
InWater = true;