1
0
Fork 0

Vivian MEAZZA:

"Implement the repeat function for submodels. Default value is 'false' "
This commit is contained in:
mfranz 2006-01-30 22:08:53 +00:00
parent dc32369bfa
commit d1ad73558f
2 changed files with 5 additions and 1 deletions

View file

@ -76,7 +76,7 @@ FGAIScenario::FGAIScenario(const string &filename)
en->m_class = entry_node->getStringValue("class", "jet_transport");
en->path = entry_node->getStringValue("model", "Models/Geometry/glider.ac");
en->flightplan = entry_node->getStringValue("flightplan", "");
en->repeat = entry_node->getDoubleValue("repeat", 0.0);
en->repeat = entry_node->getBoolValue("repeat", false);
en->latitude = entry_node->getDoubleValue("latitude", 0.0);
en->longitude = entry_node->getDoubleValue("longitude", 0.0);
en->altitude = entry_node->getDoubleValue("altitude", 0.0);

View file

@ -108,6 +108,9 @@ FGSubmodelMgr::update (double dt)
bool
FGSubmodelMgr::release (submodel* sm, double dt)
{
// only run if first time or repeat is set to true
if (!sm->first_time && !sm->repeat) return false;
sm->timer += dt;
if (sm->timer < sm->delay) return false;
sm->timer = 0.0;
@ -203,6 +206,7 @@ FGSubmodelMgr::load ()
sm->prop = fgGetNode("/ai/submodels/submodel", i, true);
sm->prop->tie("count", SGRawValuePointer<int>(&(sm->count)));
sm->prop->tie("repeat", SGRawValuePointer<bool>(&(sm->repeat)));
// sm->prop->tie("contents", SGRawValuePointer<double>(&(sm->contents)));
// sm->prop->tie("contents path", SGRawValuePointer<const char *>(&(sm->contents_node)));