Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 28, 2016, 3:09:26 PM (9 years ago)
Author:
sagerj
Message:

overwritten many fire functions now only need to implement timer/charges

File:
1 edited

Legend:

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

    r11174 r11175  
    6363        this->bAutoReload_ = true;
    6464        this->bParallelReload_ = true;
     65        this->chargeable_ = false;
    6566
    6667        this->reloadTimer_.setTimer(0.0f, false, createExecutor(createFunctor(&WeaponMode::reloaded, this)));
     
    120121    bool WeaponMode::fire(float* reloadTime)
    121122    {
     123        orxout() << "--- " << endl;
    122124        (*reloadTime) = this->reloadTime_;
    123125        // Fireing is only possible if this weapon mode is not reloading and there is enough munition
     
    170172    bool WeaponMode::push(float* reloadTime)
    171173    {
     174        orxout() << "push " << chargeable_ << endl;
    172175        if( this->chargeable_)
    173176        {
    174177            // setting up a timer for knowing how long the weapon was charged
    175178            // and passes the value to this->cTime_
     179            orxout() << "if " << endl;
     180            return false;
    176181        } else {
     182            orxout() << "else " << endl;
    177183            return fire(reloadTime);
    178184        }
    179        
    180185    }
    181186
    182187    bool WeaponMode::release(float* reloadTime)
    183188    {
     189        orxout() << "release " << endl;
    184190        if( this->chargeable_)
    185         {
     191        {
     192            orxout() << "if " << endl;
    186193            return fire(reloadTime);
     194        }else{
     195            orxout() << "else " << endl;
     196            return false;
    187197        }
    188198    }
Note: See TracChangeset for help on using the changeset viewer.