1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-03 00:46:55 +02:00

* small improvements

* probably working getting visitable objects at certain position (to be tested)
This commit is contained in:
mateuszb
2007-10-26 17:55:33 +00:00
parent b07b1ec7dc
commit c18e4573f1
5 changed files with 57 additions and 2 deletions

View File

@ -1367,3 +1367,15 @@ std::vector < std::string > CMapHandler::getObjDescriptions(int3 pos)
}
return ret;
}
std::vector < CObjectInstance * > CMapHandler::getVisitableObjs(int3 pos)
{
std::vector < CObjectInstance * > ret;
for(int h=0; h<ttiles[pos.x][pos.y][pos.z].objects.size(); ++h)
{
CObjectInstance * curi = ttiles[pos.x][pos.y][pos.z].objects[h].first;
if(curi->visitableAt(curi->pos.x - pos.x, curi->pos.y - pos.y))
ret.push_back(curi);
}
return ret;
}