bool Map::isCovered(const Position& pos, int firstFloor) { // check for tiles on top of the postion Position tilePos = pos; while(tilePos.coveredUp() && tilePos.z >= firstFloor) { TilePtr tile = getTile(tilePos); // the below tile is covered when the above tile has a full ground if(tile && tile->isFullGround()) return true; } return false; }
bool Map::isCovered(const Position& pos, int firstFloor) { Position tilePos = pos; tilePos.perspectiveUp(); while(tilePos.z >= firstFloor) { TilePtr tile = m_tiles[tilePos]; if(tile && tile->isFullGround()) return true; tilePos.perspectiveUp(); } return false; }