From Jason Beverage, "Attached is a fix for getTile in the Terrain class. It should be checking for itr == _terrainTileMap.end() instead of itr != _terrainTileMap.end()."

This commit is contained in:
Robert Osfield 2008-10-06 08:48:44 +00:00
parent eb01f3365f
commit 5fe30854dd

View File

@ -56,7 +56,7 @@ TerrainTile* Terrain::getTile(const TileID& tileID)
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_mutex);
TerrainTileMap::iterator itr = _terrainTileMap.find(tileID);
if (itr != _terrainTileMap.end()) return 0;
if (itr == _terrainTileMap.end()) return 0;
return itr->second;
}
@ -66,7 +66,7 @@ const TerrainTile* Terrain::getTile(const TileID& tileID) const
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_mutex);
TerrainTileMap::const_iterator itr = _terrainTileMap.find(tileID);
if (itr != _terrainTileMap.end()) return 0;
if (itr == _terrainTileMap.end()) return 0;
return itr->second;
}