Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 3, 2008, 3:11:48 PM (15 years ago)
Author:
polakma
Message:

fixed WeaponPack attaching

File:
1 edited

Legend:

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

    r2308 r2319  
    3636
    3737#include "WeaponSystem.h"
    38 #include "WeaponPack.h"
     38
    3939
    4040/* WEAPONSYSTEM
     
    5252
    5353        this->activeWeaponSet_ = 0;
    54         this->parentSpaceShip_ = 0;
     54        this->parentPawn_ = 0;
    5555    }
    5656
     
    5959    }
    6060
    61     void WeaponSystem::attachWeaponPack(WeaponPack *wPack, int setNumber)
     61    void WeaponSystem::attachWeaponPack(WeaponPack *wPack, unsigned int firemode)
    6262    {
    63         this->weaponSets_[setNumber]->attachWeaponPack(wPack);
     63        this->weaponSets_[firemode]->attachWeaponPack(wPack);
     64        this->weaponPacks_[firemode] = wPack;
     65        wPack->setParentWeaponSystem(this);
    6466    }
    6567
     
    125127    }
    126128
     129    WeaponPack * WeaponSystem::getWeaponPackPointer(unsigned int n)
     130    {
     131        if (n < this->weaponPacks_.size())
     132            return this->weaponPacks_[n];
     133        else
     134            return 0;
     135    }
     136
    127137    void WeaponSystem::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    128138    {
Note: See TracChangeset for help on using the changeset viewer.