]> git.mxchange.org Git - flightgear.git/blobdiff - src/AIModel/AIStorm.cxx
Don't restore initial screen geometry because there is nothing in fg_os* to resize...
[flightgear.git] / src / AIModel / AIStorm.cxx
index 15d8c4fe395747cfb51fcd070b9c7259c5845aea..5814d2895b9ece03d52593dc981239e87b8902e2 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>
 #include <string>
 #include <math.h>
 #include <cstdlib>
+#include <time.h>
 
 SG_USING_STD(string);
 
 #include "AIStorm.hxx"
 
 
-FGAIStorm::FGAIStorm(FGAIManager* mgr) {
-   manager = mgr;   
-   _type_str = "thunderstorm";
-   _otype = otStorm;
+FGAIStorm::FGAIStorm() : FGAIBase(otStorm) {
    delay = 3.6;
    subflashes = 1;
    timer = 0.0;
@@ -65,6 +63,16 @@ FGAIStorm::FGAIStorm(FGAIManager* mgr) {
 FGAIStorm::~FGAIStorm() {
 }
 
+void FGAIStorm::readFromScenario(SGPropertyNode* scFileNode) {
+  if (!scFileNode)
+    return;
+
+  FGAIBase::readFromScenario(scFileNode);
+
+  setDiameter(scFileNode->getDoubleValue("diameter-ft", 0.0)/6076.11549);
+  setHeight(scFileNode->getDoubleValue("height-msl", 5000.0));
+  setStrengthNorm(scFileNode->getDoubleValue("strength-norm", 1.0)); 
+}
 
 bool FGAIStorm::init() {
    return FGAIBase::init();
@@ -88,8 +96,6 @@ void FGAIStorm::update(double dt) {
 
 void FGAIStorm::Run(double dt) {
 
-   FGAIStorm::dt = dt;
-       
    double speed_north_deg_sec;
    double speed_east_deg_sec;