diff --git a/DetourCrowd/Include/DetourCrowd.h b/DetourCrowd/Include/DetourCrowd.h index e789fd3..0e5cc36 100644 --- a/DetourCrowd/Include/DetourCrowd.h +++ b/DetourCrowd/Include/DetourCrowd.h @@ -218,7 +218,7 @@ class dtCrowd void updateMoveRequest(const float dt); void checkPathValidity(dtCrowdAgent** agents, const int nagents, const float dt); - inline int getAgentIndex(const dtCrowdAgent* agent) const { return agent - m_agents; } + inline int getAgentIndex(const dtCrowdAgent* agent) const { return (int)(agent - m_agents); } bool requestMoveTargetReplan(const int idx, dtPolyRef ref, const float* pos); diff --git a/DetourCrowd/Source/DetourCrowd.cpp b/DetourCrowd/Source/DetourCrowd.cpp index ae95fd3..2bc5d66 100644 --- a/DetourCrowd/Source/DetourCrowd.cpp +++ b/DetourCrowd/Source/DetourCrowd.cpp @@ -1118,7 +1118,7 @@ void dtCrowd::update(const float dt, dtCrowdAgentDebugInfo* debug) if (overOffmeshConnection(ag, triggerRadius)) { // Prepare to off-mesh connection. - const int idx = ag - m_agents; + const int idx = (int)(ag - m_agents); dtCrowdAgentAnimation* anim = &m_agentAnims[idx]; // Adjust the path over the off-mesh connection. diff --git a/DetourTileCache/Source/DetourTileCache.cpp b/DetourTileCache/Source/DetourTileCache.cpp index 5eb6e22..9d9e7dd 100644 --- a/DetourTileCache/Source/DetourTileCache.cpp +++ b/DetourTileCache/Source/DetourTileCache.cpp @@ -213,14 +213,14 @@ dtCompressedTile* dtTileCache::getTileAt(const int tx, const int ty, const int t dtCompressedTileRef dtTileCache::getTileRef(const dtCompressedTile* tile) const { if (!tile) return 0; - const unsigned int it = tile - m_tiles; + const unsigned int it = (unsigned int)(tile - m_tiles); return (dtCompressedTileRef)encodeTileId(tile->salt, it); } dtObstacleRef dtTileCache::getObstacleRef(const dtTileCacheObstacle* ob) const { if (!ob) return 0; - const unsigned int idx = ob - m_obstacles; + const unsigned int idx = (unsigned int)(ob - m_obstacles); return encodeObstacleId(ob->salt, idx); }