Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 12, 2008, 12:50:18 PM (15 years ago)
Author:
polakma
Message:

made some changes (still doesn't compile)

File:
1 edited

Legend:

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

    r2145 r2186  
    4242        RegisterObject(Weapon);
    4343        this->weaponReadyToShoot_ = true;
    44         //this->setParentWeaponSystem();
     44        this->setParentWeaponSystem();
     45        this->pointerToMunition_ = this->parentWeaponSystem_->getAttachedMunitionPointer;
     46        this->attachNeededMunition(this->pointerToMunition_);
    4547
    4648    }
     
    6668    }
    6769
    68     void Weapon::attachNeededMunition(Munition *PointerToMunition)
     70    void attachNeededMunition(Munition *pointerToMunition)
    6971    {
     72        //if munition type already exist attach it, else create a new one of this type and attach it to the weapon and to the WeaponSystem
     73        if ( this->parentWeaponSystem_->munitionSet_[laserGunMunition] )
     74            this->pointerToMunition_ = pointerToMunition;
     75        else
     76        {
     77            this->pointerToMunition_ = new LaserGunMunition;
     78            this->parentWeaponSystem_->munitionSet_[laserGunMunition] = this->pointerToMunition_;
    7079
     80        }
    7181    }
     82
    7283/*
    7384    void Weapon::setParentWeaponSystem()
Note: See TracChangeset for help on using the changeset viewer.