Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 17, 2005, 2:09:59 AM (20 years ago)
Author:
bensch
Message:

orxonox/branches/openAL: segfault-prevention :)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/openAL/src/lib/sound/sound_engine.cc

    r4204 r4205  
    234234
    235235  // updating the Listeners Position
    236   if (this->listener)
     236  if (likely(this->listener != NULL))
    237237    {
    238238      alListener3f(AL_POSITION,
     
    256256  while (enumSource)
    257257    {
    258       alSource3f(enumSource->getID(), AL_POSITION,
    259                  enumSource->getNode()->getAbsCoor().x,
    260                  enumSource->getNode()->getAbsCoor().y,
    261                  enumSource->getNode()->getAbsCoor().z);
    262       alSource3f(enumSource->getID(), AL_VELOCITY,
    263                  enumSource->getNode()->getVelocity().x,
    264                  enumSource->getNode()->getVelocity().y,
    265                  enumSource->getNode()->getVelocity().z);
    266 
     258      if (likely(enumSource->getNode()!=NULL))
     259      {
     260        alSource3f(enumSource->getID(), AL_POSITION,
     261                   enumSource->getNode()->getAbsCoor().x,
     262                   enumSource->getNode()->getAbsCoor().y,
     263                   enumSource->getNode()->getAbsCoor().z);
     264        alSource3f(enumSource->getID(), AL_VELOCITY,
     265                   enumSource->getNode()->getVelocity().x,
     266                   enumSource->getNode()->getVelocity().y,
     267                   enumSource->getNode()->getVelocity().z);
     268      }
    267269      enumSource = iterator->nextElement();
    268270    }
Note: See TracChangeset for help on using the changeset viewer.