mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-26 03:52:01 +02:00
Refactoring
This commit is contained in:
parent
6d502ef1a1
commit
bfd4ff8954
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user