Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 17, 2016, 2:58:59 PM (8 years ago)
Author:
landauf
Message:

shortened code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v3/src/orxonox/controllers/SectionController.cc

    r11065 r11067  
    174174        this->setFormationMode( this->myDivisionLeader_->getFormationMode() );
    175175        this->spread_ = this->myDivisionLeader_->getSpread();
    176         Vector3* targetRelativePosition;
    177176        switch (this->formationMode_){
    178177            case FormationMode::WALL:
    179             {
    180                 targetRelativePosition = new Vector3 (-2.0f*this->spread_, 0, 0);   
    181                 break;
    182             }
     178                return Vector3 (-2.0f*this->spread_, 0, 0);
     179
    183180            case FormationMode::FINGER4:
    184             {
    185                 targetRelativePosition = new Vector3 (-2.0f*this->spread_, 0, 1.0f*this->spread_);   
    186                 break;
    187             }
     181                return Vector3 (-2.0f*this->spread_, 0, 1.0f*this->spread_);
    188182           
    189183            case FormationMode::DIAMOND:
    190             {
    191                 targetRelativePosition = new Vector3 (-2.0f*this->spread_, 0, 1.0f*this->spread_);
    192                 break;
    193             }
    194         }
    195         Vector3 result = *targetRelativePosition;
    196         delete targetRelativePosition;
    197         return result;
     184                return Vector3 (-2.0f*this->spread_, 0, 1.0f*this->spread_);
     185
     186            default:
     187                return Vector3::ZERO;
     188        }
    198189    }
    199190
Note: See TracChangeset for help on using the changeset viewer.