1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-26 03:52:01 +02:00

Refactoring

This commit is contained in:
DjWarmonger 2015-05-25 17:04:17 +02:00
parent 6d502ef1a1
commit bfd4ff8954

View File

@ -342,13 +342,11 @@ bool CMap::checkForVisitableDir(const int3 & src, const TerrainTile *pom, const
{
if (!pom->entrableTerrain()) //rock is never accessible
return false;
for(ui32 b=0; b<pom->visitableObjects.size(); ++b) //checking destination tile
for (auto obj : pom->visitableObjects) //checking destination tile
{
if(!vstd::contains(pom->blockingObjects, pom->visitableObjects[b])) //this visitable object is not blocking, ignore
if(!vstd::contains(pom->blockingObjects, obj)) //this visitable object is not blocking, ignore
continue;
const CGObjectInstance * obj = pom->visitableObjects[b];
if (!obj->appearance.isVisitableFrom(src.x - dst.x, src.y - dst.y))
return false;
}