David Culp: This is n idea from Vivian, it allows setting the count to a negative number which will give unlimited submodels (as long as the trigger is true). This is useful for contrails.
This commit is contained in:
parent
af284e4bb9
commit
fdab44652e
1 changed files with 2 additions and 2 deletions
|
@ -64,7 +64,7 @@ SubmodelSystem::update (double dt)
|
||||||
while(submodel_iterator != submodels.end()) {
|
while(submodel_iterator != submodels.end()) {
|
||||||
i++;
|
i++;
|
||||||
if ((*submodel_iterator)->trigger->getBoolValue()) {
|
if ((*submodel_iterator)->trigger->getBoolValue()) {
|
||||||
if ((*submodel_iterator)->count > 0) {
|
if ((*submodel_iterator)->count != 0) {
|
||||||
release( (*submodel_iterator), dt);
|
release( (*submodel_iterator), dt);
|
||||||
// now update the "count" property for this submodel
|
// now update the "count" property for this submodel
|
||||||
char name[80];
|
char name[80];
|
||||||
|
@ -90,7 +90,7 @@ SubmodelSystem::release (submodel* sm, double dt)
|
||||||
int rval = ai->createBallistic( sm->model, IC.lat, IC.lon, IC.alt, IC.azimuth,
|
int rval = ai->createBallistic( sm->model, IC.lat, IC.lon, IC.alt, IC.azimuth,
|
||||||
IC.elevation, IC.speed, sm->drag_area, sm->life );
|
IC.elevation, IC.speed, sm->drag_area, sm->life );
|
||||||
//cout << "Submodel created." << endl;
|
//cout << "Submodel created." << endl;
|
||||||
(sm->count)--;
|
if (sm->count > 0) (sm->count)--;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue