bool GameLevel::isPassable(int x, int y) const { if (x > 0 && x < width() && y > 0 && y < height() && !mLevel.get(x, y).passable()) return false; FAWorld::Actor* actor = getActorAt(x, y); return actor == NULL || actor->isPassable(); }
bool GameLevel::isPassable(const Misc::Point& point, const FAWorld::Actor* forActor) const { // Special hack because griswold spawns on an unpassable tile. // TODO: This should be fixed later by a patch on the town level data. if (forActor && forActor->mIsTowner) return true; if (point.x < 0 || point.x >= width() || point.y < 0 || point.y >= height() || !mLevel.get(point).passable()) return false; FAWorld::Actor* actor = getActorAt(point); return actor == nullptr || actor == forActor; }
bool GameLevel::isPassableFor(int x, int y, const Actor* actor) const { auto actorAtPos = getActorAt(x, y); return mLevel.get(x, y).passable() && (actorAtPos == nullptr || actorAtPos == actor || actorAtPos->isPassable()); }