]> git.mxchange.org Git - flightgear.git/blobdiff - src/AIModel/AIThermal.cxx
Remove unused variables
[flightgear.git] / src / AIModel / AIThermal.cxx
index 1655b40aea596cb3ba283b1c1a7748b5db8fc2b2..d01421c734c9c2fea76b67baf09239f0ee3ec7d6 100644 (file)
@@ -16,7 +16,7 @@
 //
 // You should have received a copy of the GNU General Public License
 // along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
 #ifdef HAVE_CONFIG_H
 #  include <config.h>
@@ -54,9 +54,10 @@ void FGAIThermal::readFromScenario(SGPropertyNode* scFileNode) {
   setHeight(scFileNode->getDoubleValue("height-msl", 5000.0));
 }
 
-bool FGAIThermal::init() {
+bool FGAIThermal::init(bool search_in_AI_path) {
    factor = 8.0 * max_strength / (diameter * diameter * diameter);
-   return FGAIBase::init();
+   setAltitude( height );
+   return FGAIBase::init(search_in_AI_path);
 }
 
 void FGAIThermal::bind() {
@@ -87,8 +88,8 @@ void FGAIThermal::Run(double dt) {
    double user_altitude  = manager->get_user_altitude();
 
    // calculate range to target in feet and nautical miles
-   double lat_range = fabs(pos.lat() - user_latitude) * ft_per_deg_lat;
-   double lon_range = fabs(pos.lon() - user_longitude) * ft_per_deg_lon;
+   double lat_range = fabs(pos.getLatitudeDeg() - user_latitude) * ft_per_deg_lat;
+   double lon_range = fabs(pos.getLongitudeDeg() - user_longitude) * ft_per_deg_lon;
    double range_ft = sqrt(lat_range*lat_range + lon_range*lon_range);
    range = range_ft / 6076.11549;