Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 10, 2008, 5:30:39 PM (15 years ago)
Author:
polakma
Message:

fixed projectile, particle effect, reloadingTimer and magazineTimer

File:
1 edited

Legend:

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

    r2379 r2391  
    4646    }
    4747
    48     bool Munition::bullets()
     48    unsigned int Munition::bullets()
    4949    {
    5050        if (this->bullets_ > 0)
    51             return true;
     51            return bullets_;
    5252        else
    53             return false;
     53            return 0;
    5454    }
    5555
    56     bool Munition::magazines()
     56    unsigned int Munition::magazines()
    5757    {
    5858        if (this->magazines_ > 0)
    59             return true;
     59            return magazines_;
    6060        else
    61             return false;
     61            return 0;
    6262    }
    6363
     
    6868    { this->maxMagazines_ = amount; }
    6969
    70     void Munition::removeBullets(unsigned int amount, Weapon * parentWeapon)
     70    void Munition::removeBullets(unsigned int amount)
    7171    {
    72         if ( this->bullets_ == 0 )
    73         {
    74             this->removeMagazines(1);
    75             parentWeapon->magazineTimer(0);
    76             this->bullets_ = this->maxBullets_;
    77         }
    78         else
     72        if ( this->bullets_ != 0 )
    7973            this->bullets_ = this->bullets_ - amount;
    8074    }
     
    8276    void Munition::removeMagazines(unsigned int amount)
    8377    {
    84         if ( this->magazines_ == 0 )
    85         {
    86             if ( this->bullets_ == 0 )
    87                 {
    88                     //no bullets and no magazines
    89                 }
    90             else
    91             {
    92                 //what to do when there are no more magazines?
    93             }
    94         }
    95         else
     78        if ( this->magazines_ != 0 )
    9679            this->magazines_ = this->magazines_ - amount;
    9780    }
     
    120103    void Munition::fillBullets()
    121104    {
     105COUT(0) << "Munition::fillBullets maxBullets_=" << this->maxBullets_ << std::endl;
    122106        this->bullets_ = this->maxBullets_;
    123107    }
     
    130114    void Munition::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    131115    {
    132 
     116        SUPER(Munition, XMLPort, xmlelement, mode);
    133117    }
    134118
Note: See TracChangeset for help on using the changeset viewer.