Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 3, 2008, 6:26:53 PM (15 years ago)
Author:
polakma
Message:

fixed parentWeaponSystem-Pointer for all WeaponPacks and its Weapons

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/weapon2/src/orxonox/objects/weaponSystem/Weapon.cc

    r2331 r2337  
    4444        this->bulletReadyToShoot_ = true;
    4545        this->magazineReadyToShoot_ = true;
     46        this->parentWeaponSystem_ = 0;
     47        this->parentWeaponSlot_ = 0;
     48        this->munition_ = 0;
    4649    }
    4750
     
    9093            {
    9194                //create new munition with identifier
     95COUT(0) << "Weapon::attachNeededMunition, create new Munition of Type " << munitionName << std::endl;
    9296                this->munitionIdentifier_ = ClassByString(munitionName);
    9397                this->munition_ = this->munitionIdentifier_.fabricate(this);
     
    108112    {   return this->munitionType_;  }
    109113
    110     Munition * Weapon::getAttachedMunition()
    111     {   return this->munition_; }
     114    Munition * Weapon::getAttachedMunition(std::string munitionType)
     115    {   
     116COUT(0) << "Weapon::getAttachedMunition, parentWeaponSystem_="<< this->parentWeaponSystem_ << std::endl;   
     117        this->parentWeaponSystem_->getMunitionType(munitionType);
     118COUT(0) << "Weapon::getAttachedMunition, munition_="<< this->munition_ << std::endl;
     119return this->munition_; }
    112120
    113121    void Weapon::setBulletLoadingTime(float loadingTime)
Note: See TracChangeset for help on using the changeset viewer.