bool PlanetManagerImplementation::isTravelToLocationPermitted(const String& departurePoint, const String& arrivalPlanet, const String& arrivalPoint) { //Check to see that the departure point exists. if (!isExistingPlanetTravelPoint(departurePoint)) return false; //Check to see that the arrival planet exists. ManagedReference<Zone*> arrivalZone = zone->getZoneServer()->getZone(arrivalPlanet); if (arrivalZone == NULL) return false; PlanetManager* arrivalPlanetManager = arrivalZone->getPlanetManager(); //Check to see that the arrival point exists. if (!arrivalPlanetManager->isExistingPlanetTravelPoint(arrivalPoint)) return false; //Check to see if incoming Travel is allowed if (!arrivalPlanetManager->isIncomingTravelAllowed(arrivalPoint)) return false; //If both zones are the same, then intraplanetary travel is allowed. if (arrivalZone == zone) return true; //Check to see if interplanetary travel is allowed between both points. if (!isInterplanetaryTravelAllowed(departurePoint) || !arrivalPlanetManager->isInterplanetaryTravelAllowed(arrivalPoint)) return false; return true; }