Fix a small number of potential problems.
This commit is contained in:
parent
986492d72d
commit
56f6d3b800
3 changed files with 16 additions and 12 deletions
|
@ -43,7 +43,12 @@
|
||||||
#include "AIBase.hxx"
|
#include "AIBase.hxx"
|
||||||
#include "AIManager.hxx"
|
#include "AIManager.hxx"
|
||||||
|
|
||||||
FGAIBase::FGAIBase() {
|
FGAIBase::FGAIBase()
|
||||||
|
: fp( NULL ),
|
||||||
|
model( NULL ),
|
||||||
|
props( NULL ),
|
||||||
|
manager( NULL )
|
||||||
|
{
|
||||||
_type_str = "model";
|
_type_str = "model";
|
||||||
tgt_roll = roll = tgt_pitch = tgt_yaw = tgt_vs = vs = pitch = 0.0;
|
tgt_roll = roll = tgt_pitch = tgt_yaw = tgt_vs = vs = pitch = 0.0;
|
||||||
bearing = elevation = range = rdot = 0.0;
|
bearing = elevation = range = rdot = 0.0;
|
||||||
|
@ -53,12 +58,9 @@ FGAIBase::FGAIBase() {
|
||||||
no_roll = true;
|
no_roll = true;
|
||||||
life = 900;
|
life = 900;
|
||||||
model_path = "";
|
model_path = "";
|
||||||
model = 0;
|
|
||||||
_otype = otNull;
|
_otype = otNull;
|
||||||
index = 0;
|
index = 0;
|
||||||
fp = (FGAIFlightPlan*)0;
|
|
||||||
delete_me = false;
|
delete_me = false;
|
||||||
manager = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FGAIBase::~FGAIBase() {
|
FGAIBase::~FGAIBase() {
|
||||||
|
@ -67,6 +69,7 @@ FGAIBase::~FGAIBase() {
|
||||||
SGPropertyNode *root = globals->get_props()->getNode("ai/models", true);
|
SGPropertyNode *root = globals->get_props()->getNode("ai/models", true);
|
||||||
root->removeChild(_type_str.c_str(), index);
|
root->removeChild(_type_str.c_str(), index);
|
||||||
if (fp) delete fp;
|
if (fp) delete fp;
|
||||||
|
fp = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FGAIBase::update(double dt) {
|
void FGAIBase::update(double dt) {
|
||||||
|
|
|
@ -199,10 +199,10 @@ FGAIManager::createBallistic( FGAIModelEntity *entity ) {
|
||||||
ai_ballistic->setDragArea(entity->eda);
|
ai_ballistic->setDragArea(entity->eda);
|
||||||
ai_ballistic->setLife(entity->life);
|
ai_ballistic->setLife(entity->life);
|
||||||
ai_ballistic->setBuoyancy(entity->buoyancy);
|
ai_ballistic->setBuoyancy(entity->buoyancy);
|
||||||
ai_ballistic->setWind_from_east(entity->wind_from_east);
|
ai_ballistic->setWind_from_east(entity->wind_from_east);
|
||||||
ai_ballistic->setWind_from_north(entity->wind_from_north);
|
ai_ballistic->setWind_from_north(entity->wind_from_north);
|
||||||
ai_ballistic->setWind(entity->wind);
|
ai_ballistic->setWind(entity->wind);
|
||||||
ai_ballistic->setRoll(entity->roll);
|
ai_ballistic->setRoll(entity->roll);
|
||||||
ai_ballistic->init();
|
ai_ballistic->init();
|
||||||
ai_ballistic->bind();
|
ai_ballistic->bind();
|
||||||
return ai_ballistic;
|
return ai_ballistic;
|
||||||
|
|
|
@ -74,10 +74,11 @@ FGAIScenario::FGAIScenario(string filename)
|
||||||
en->diameter = entry_node->getDoubleValue("diameter-ft", 0.0);
|
en->diameter = entry_node->getDoubleValue("diameter-ft", 0.0);
|
||||||
en->eda = entry_node->getDoubleValue("eda", 0.007);
|
en->eda = entry_node->getDoubleValue("eda", 0.007);
|
||||||
en->life = entry_node->getDoubleValue("life", 900.0);
|
en->life = entry_node->getDoubleValue("life", 900.0);
|
||||||
en->buoyancy = entry_node->getDoubleValue("buoyancy", 0);
|
en->buoyancy = entry_node->getDoubleValue("buoyancy", 0);
|
||||||
en->wind_from_east = entry_node->getDoubleValue("wind_from_east", 0);
|
en->wind_from_east = entry_node->getDoubleValue("wind_from_east", 0);
|
||||||
en->wind_from_north = entry_node->getDoubleValue("wind_from_north", 0);
|
en->wind_from_north = entry_node->getDoubleValue("wind_from_north", 0);
|
||||||
en->wind = entry_node->getBoolValue("wind", false);
|
en->wind = entry_node->getBoolValue("wind", false);
|
||||||
|
en->fp = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
entry_iterator = entries.begin();
|
entry_iterator = entries.begin();
|
||||||
|
|
Loading…
Add table
Reference in a new issue