Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6823 in orxonox.OLD for trunk/src/lib/particles/particle_system.cc


Ignore:
Timestamp:
Jan 29, 2006, 2:20:46 AM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: BoxEmitter

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/particles/particle_system.cc

    r6757 r6823  
    140140  {
    141141    BaseObject* emitter = Factory::fabricate(element);
    142     if (emitter->isA(CL_PARTICLE_EMITTER))
    143       this->addEmitter(dynamic_cast<ParticleEmitter*>(emitter));
     142    if (emitter != NULL)
     143    {
     144      if (emitter->isA(CL_PARTICLE_EMITTER))
     145        this->addEmitter(dynamic_cast<ParticleEmitter*>(emitter));
     146      else
     147      {
     148        PRINTF(2)("Tried to load an Element of type '%s' that should be a ParticleEmitter onto '%s::%s'.\n",
     149                  emitter->getClassName(), this->getClassName(), this->getName());
     150        delete emitter;
     151      }
     152    }
    144153    else
    145154    {
    146       PRINTF(2)("Tried to load an Element of type '%s' that should be a ParticleEmitter onto '%s::%s'.\n",
    147                 emitter->getClassName(), this->getClassName(), this->getName());
    148       delete emitter;
     155      PRINTF(2)("Could not Generate Emitter for system %s::%s (wrong type in XML-format)\n", this->getClassName(), getName());
    149156    }
    150157  }
Note: See TracChangeset for help on using the changeset viewer.