diff options
author | Shauren <shauren.trinity@gmail.com> | 2015-03-08 22:04:34 +0100 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2015-03-08 22:04:34 +0100 |
commit | e15ba34444b4484cebbe2070e0f205ccf9c69a16 (patch) | |
tree | 47560de814f2112b3adc6162bc7ac0559608b5fc /src/server/collision/Management/MMapManager.cpp | |
parent | 75f0cabde74ed491bfe1545d2291f6ce28993ccf (diff) |
Core/Misc: Cleaned up data truncation warnings
Diffstat (limited to 'src/server/collision/Management/MMapManager.cpp')
-rw-r--r-- | src/server/collision/Management/MMapManager.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/server/collision/Management/MMapManager.cpp b/src/server/collision/Management/MMapManager.cpp index 170350d4de4..8c549017f12 100644 --- a/src/server/collision/Management/MMapManager.cpp +++ b/src/server/collision/Management/MMapManager.cpp @@ -39,7 +39,7 @@ namespace MMAP return true; // load and init dtNavMesh - read parameters from file - uint32 pathLen = sWorld->GetDataPath().length() + strlen("mmaps/%03i.mmap")+1; + uint32 pathLen = uint32(sWorld->GetDataPath().length() + strlen("mmaps/%03i.mmap") + 1); char *fileName = new char[pathLen]; snprintf(fileName, pathLen, (sWorld->GetDataPath()+"mmaps/%03i.mmap").c_str(), mapId); @@ -52,7 +52,7 @@ namespace MMAP } dtNavMeshParams params; - int count = fread(¶ms, sizeof(dtNavMeshParams), 1, file); + uint32 count = uint32(fread(¶ms, sizeof(dtNavMeshParams), 1, file)); fclose(file); if (count != 1) { @@ -104,7 +104,7 @@ namespace MMAP return false; // load this tile :: mmaps/MMMXXYY.mmtile - uint32 pathLen = sWorld->GetDataPath().length() + strlen("mmaps/%03i%02i%02i.mmtile")+1; + uint32 pathLen = uint32(sWorld->GetDataPath().length() + strlen("mmaps/%03i%02i%02i.mmtile") + 1); char *fileName = new char[pathLen]; snprintf(fileName, pathLen, (sWorld->GetDataPath()+"mmaps/%03i%02i%02i.mmtile").c_str(), mapId, x, y); @@ -159,13 +159,9 @@ namespace MMAP TC_LOG_INFO("maps", "MMAP:loadMap: Loaded mmtile %03i[%02i, %02i] into %03i[%02i, %02i]", mapId, x, y, mapId, header->x, header->y); return true; } - else - { - TC_LOG_ERROR("maps", "MMAP:loadMap: Could not load %03u%02i%02i.mmtile into navmesh", mapId, x, y); - dtFree(data); - return false; - } + TC_LOG_ERROR("maps", "MMAP:loadMap: Could not load %03u%02i%02i.mmtile into navmesh", mapId, x, y); + dtFree(data); return false; } |