Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 7, 2009, 2:23:46 PM (15 years ago)
Author:
scheusso
Message:

fixed weapon sound source problem

Location:
code/branches/presentation2/src/orxonox/weaponsystem
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2/src/orxonox/weaponsystem/WeaponMode.cc

    r6245 r6265  
    3939#include "WeaponPack.h"
    4040#include "WeaponSystem.h"
     41#include "WeaponSlot.h"
    4142
    4243#include "sound/WorldSound.h"
     
    7273        this->defSndWpnFire_ = new WorldSound(this);
    7374        this->defSndWpnFire_->setLooping(false);
     75        this->bSoundAttached_ = false;
    7476    }
    7577
     
    104106    {
    105107        (*reloadTime) = this->reloadTime_;
     108        if( !this->bSoundAttached_ )
     109        {
     110            assert(this->getWeapon() && this->getWeapon()->getWeaponSlot());
     111            this->getWeapon()->getWeaponSlot()->attach(this->defSndWpnFire_);
     112            this->bSoundAttached_ = true;
     113        }
    106114
    107115        if (!this->bReloading_ && this->munition_ && this->munition_->takeMunition(this->munitionPerShot_, this))
     
    122130            this->reloadTimer_.startTimer();
    123131
    124             assert( this->getWeapon() && this->getWeapon()->getWeaponPack() && this->getWeapon()->getWeaponPack()->getWeaponSystem() && this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn() );
    125             this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->attach(this->defSndWpnFire_);
    126132            if(!(this->defSndWpnFire_->isPlaying()))
    127133            {
  • code/branches/presentation2/src/orxonox/weaponsystem/WeaponMode.h

    r6245 r6265  
    166166
    167167            WorldSound* defSndWpnFire_;
     168            bool        bSoundAttached_;
    168169    };
    169170}
Note: See TracChangeset for help on using the changeset viewer.