Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 3, 2012, 6:05:24 PM (13 years ago)
Author:
landauf
Message:

replaced tabs with spaces (no code changed)

Location:
code/branches/presentation2012merge/src/orxonox
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2012merge/src/orxonox/LevelInfo.h

    r9269 r9272  
    2424 *   Co-authors:
    2525 *      ...
    26  *   
     26 *
    2727 */
    2828
     
    7979            */
    8080            inline const std::string& getName(void) const { return this->name_; } // tolua_export
    81        
     81
    8282            /**
    8383            @brief Set the screenshot of the Level.
     
    117117            */
    118118            inline bool hasTag(const std::string& tag) const { return this->tags_.find(tag) != this->tags_.end(); } // tolua_export
    119  
     119
    120120            void setShips(const std::string& ships); //!< Set the starting ship models of the level
    121121            bool addShip(const std::string& ship, bool update = true); //!< Add a model to shipselection
     
    125125            */
    126126            inline const std::string& getShips(void) const
    127                 { return this->startingShipsString_; }   
     127                { return this->startingShipsString_; }
    128128            /**
    129129            @brief Get whether the Level allows a specific starting ship model
     
    131131            @return Returns true if the Level allows the input ship model
    132132            */
    133             inline bool hasShip(const std::string& ship) const { return this->ships_.find(ship) != this->ships_.end(); } // tolua_export       
     133            inline bool hasShip(const std::string& ship) const { return this->ships_.find(ship) != this->ships_.end(); } // tolua_export
    134134            /**
    135135            @brief Get the XML-filename of the Level.
     
    138138
    139139            inline const std::string& getXMLFilename(void) const { return this->xmlfilename_; } // tolua_export
    140             inline void selectShip (const std::string& ship) { this->changeShip(ship); } // tolua_export
     140            inline void selectShip (const std::string& ship) { this->changeShip(ship); } // tolua_export
    141141
    142142
     
    153153        private:
    154154
    155             inline void changeShip (const std::string& model) {
    156                 static std::string shipSelectionTag = "shipselection";
    157                 //HACK: Read Level XML File, find "shipselection", replace with ship model
    158                 std::string levelPath = "../levels/";
    159                 levelPath.append(this->getXMLFilename());
    160                 std::string tempPath = "../levels/";
    161                 tempPath.append("_temp.oxw");
    162                 orxout(user_status) << levelPath << endl;
    163                 orxout(user_status) << tempPath << endl;
    164                 std::ifstream myLevel (levelPath.c_str());
    165                         std::ofstream tempLevel (tempPath.c_str());
    166                         while(!myLevel.eof())
    167                         {
    168                                 std::string buff;
    169                                 std::getline(myLevel, buff);
    170                                 std::string pawndesignString = "pawndesign=";
    171                                 size_t found = buff.find(pawndesignString.append(shipSelectionTag));
    172                                 if (found!= std::string::npos)
    173                                         buff = buff.substr(0, found + 11) + model + buff.substr(found+11+shipSelectionTag.length(), std::string::npos);
    174                                 tempLevel.write(buff.c_str(), buff.length());
    175                                 tempLevel << std::endl;
    176                         }
    177                         myLevel.close();
    178                         tempLevel.close();
    179                         orxout(user_status) << "done" << endl;
    180             }
     155            inline void changeShip (const std::string& model) {
     156                static std::string shipSelectionTag = "shipselection";
     157                //HACK: Read Level XML File, find "shipselection", replace with ship model
     158                std::string levelPath = "../levels/";
     159                levelPath.append(this->getXMLFilename());
     160                std::string tempPath = "../levels/";
     161                tempPath.append("_temp.oxw");
     162                orxout(user_status) << levelPath << endl;
     163                orxout(user_status) << tempPath << endl;
     164                std::ifstream myLevel (levelPath.c_str());
     165                std::ofstream tempLevel (tempPath.c_str());
     166                while(!myLevel.eof())
     167                {
     168                    std::string buff;
     169                    std::getline(myLevel, buff);
     170                    std::string pawndesignString = "pawndesign=";
     171                    size_t found = buff.find(pawndesignString.append(shipSelectionTag));
     172                    if (found!= std::string::npos)
     173                        buff = buff.substr(0, found + 11) + model + buff.substr(found+11+shipSelectionTag.length(), std::string::npos);
     174                    tempLevel.write(buff.c_str(), buff.length());
     175                    tempLevel << std::endl;
     176                }
     177                myLevel.close();
     178                tempLevel.close();
     179                orxout(user_status) << "done" << endl;
     180            }
    181181            void tagsUpdated(void); //!< Updates the comma-seperated string of all tags, if the set of tags has changed.
    182182            void shipsUpdated(void); //!< Updates the comma-seperated string of all tags, if the set of tags has changed.
     
    199199            std::string tagsString_; //!< The comma-seperated string of all the tags the Level is tagged with.
    200200            std::set<std::string> ships_; //!< The set of starting ship models the Level allows.
    201             std::string startingShipsString_; //!< The comma-seperated string of all the allowed ship models for the shipselection.           
     201            std::string startingShipsString_; //!< The comma-seperated string of all the allowed ship models for the shipselection.
    202202    }; // tolua_export
    203203
     
    210210        - @b screenshot The screenshot of the level.
    211211        - @b tags A comma-seperated string of tags. Allowed tags are: <em>test</em>, <em>singleplayer</em>, <em>multiplayer</em>, <em>showcase</em>, <em>tutorial</em>, <em>presentation</em>, <em>shipselection</em>.
    212         - @b (optional) startingships The comma-seperated string of starting ship models 
     212        - @b (optional) startingships The comma-seperated string of starting ship models
    213213        An example would be:
    214214        @code
     
    224224    @author
    225225        Damian 'Mozork' Frick
    226         @edit
    227                 Matthias Hutter
     226    @edit
     227        Matthias Hutter
    228228    @ingroup Orxonox
    229229    */
     
    235235
    236236            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Creates a LevelInfo object through XML.
    237        
     237
    238238            /**
    239239            @brief Set the screenshot of the Level.
     
    283283            */
    284284            inline const std::string& getShips(void) const
    285                 { return this->LevelInfoItem::getShips(); }             
     285                { return this->LevelInfoItem::getShips(); }
    286286            LevelInfoItem* copy(void); //!< Copies the contents of this LevelInfo object to a new LevelInfoItem object.
    287287    };
     
    302302            }
    303303    };
    304    
     304
    305305} // tolua_export
    306306
  • code/branches/presentation2012merge/src/orxonox/ShipManager.cc

    r9271 r9272  
    2222 *   Author:
    2323 *      Matthias Hutter
    24  *   
     24 *
    2525 */
    2626
     
    2828    @file ShipManager.cc
    2929    @brief Work-in Progress: Implementation of the ShipManager singleton.
    30            Should make SpaceShip info available to lua handlers.
     30           Should make SpaceShip info available to lua handlers.
    3131*/
    3232
     
    7272    }
    7373
    74    
     74
    7575    /**
    7676    @brief
     
    132132    void ShipManager::compileAvailableShipList()
    133133    {
    134                 /*
    135                 // We only want to load as little as possible
    136                 ClassTreeMask mask;
    137                     mask.exclude(Class(BaseObject));
    138                     mask.include(Class(SpaceShip));
    139                 SpaceShip* info = NULL;
    140                 XMLFile file = XMLFile(ship);
    141                 Loader::load(&file, mask, false, true);
    142                 for(ObjectList<SpaceShip>::iterator item = ObjectList<SpaceShip>::begin(); item != ObjectList<SpaceShip>::end(); ++item)
    143                         if(item->getXMLFilename() == *it)
    144                             info = item->copy();
    145                 Loader::unload(&file);
    146                 */
    147    
     134        /*
     135        // We only want to load as little as possible
     136        ClassTreeMask mask;
     137            mask.exclude(Class(BaseObject));
     138            mask.include(Class(SpaceShip));
     139        SpaceShip* info = NULL;
     140        XMLFile file = XMLFile(ship);
     141        Loader::load(&file, mask, false, true);
     142        for(ObjectList<SpaceShip>::iterator item = ObjectList<SpaceShip>::begin(); item != ObjectList<SpaceShip>::end(); ++item)
     143                if(item->getXMLFilename() == *it)
     144                    info = item->copy();
     145        Loader::unload(&file);
     146        */
     147
    148148        // Get all files matching the level criteria
    149149        Ogre::StringVectorPtr levels = Resource::findResourceNames("*.oxw");
  • code/branches/presentation2012merge/src/orxonox/controllers/FormationController.cc

    r9271 r9272  
    5050{
    5151
    52   SetConsoleCommand("FormationController", "formationflight",  &FormationController::formationflight);
    53   SetConsoleCommand("FormationController", "masteraction",     &FormationController::masteraction);
    54   SetConsoleCommand("FormationController", "followme",         &FormationController::followme);
    55   SetConsoleCommand("FormationController", "passivebehaviour", &FormationController::passivebehaviour);
    56   SetConsoleCommand("FormationController", "formationsize",    &FormationController::formationsize);
    57 
    58 
    59 
    60 
    61   static const unsigned int STANDARD_MAX_FORMATION_SIZE = 9;
    62   static const int RADIUS_TO_SEARCH_FOR_MASTERS = 5000;
    63   static const float FORMATION_LENGTH =  110;
    64   static const float FORMATION_WIDTH =  110;
    65   static const int FREEDOM_COUNT = 4; //seconds the slaves in a formation will be set free when master attacks an enemy
    66   static const float SPEED_MASTER = 0.6f;
    67   static const float ROTATEFACTOR_MASTER = 0.2f;
    68   static const float SPEED_FREE = 0.8f;
    69   static const float ROTATEFACTOR_FREE = 0.8f;
    70 
    71   FormationController::FormationController(BaseObject* creator) : Controller(creator)
    72   {
     52    SetConsoleCommand("FormationController", "formationflight",  &FormationController::formationflight);
     53    SetConsoleCommand("FormationController", "masteraction",     &FormationController::masteraction);
     54    SetConsoleCommand("FormationController", "followme",         &FormationController::followme);
     55    SetConsoleCommand("FormationController", "passivebehaviour", &FormationController::passivebehaviour);
     56    SetConsoleCommand("FormationController", "formationsize",    &FormationController::formationsize);
     57
     58
     59
     60
     61    static const unsigned int STANDARD_MAX_FORMATION_SIZE = 9;
     62    static const int RADIUS_TO_SEARCH_FOR_MASTERS = 5000;
     63    static const float FORMATION_LENGTH =  110;
     64    static const float FORMATION_WIDTH =  110;
     65    static const int FREEDOM_COUNT = 4; //seconds the slaves in a formation will be set free when master attacks an enemy
     66    static const float SPEED_MASTER = 0.6f;
     67    static const float ROTATEFACTOR_MASTER = 0.2f;
     68    static const float SPEED_FREE = 0.8f;
     69    static const float ROTATEFACTOR_FREE = 0.8f;
     70
     71    FormationController::FormationController(BaseObject* creator) : Controller(creator)
     72    {
    7373        RegisterObject(FormationController);
    7474
     
    9191        this->team_=-1;
    9292        this->target_.setCallback(createFunctor(&FormationController::targetDied, this));
    93   }
    94 
    95   FormationController::~FormationController()
    96   {
    97     if (this->isInitialized())
     93    }
     94
     95    FormationController::~FormationController()
     96    {
     97        if (this->isInitialized())
    9898        {
    9999            this->removeFromFormation();
     
    123123            }
    124124        }
    125   }
    126 
    127   void FormationController::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     125    }
     126
     127    void FormationController::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    128128    {
    129129        SUPER(FormationController, XMLPort, xmlelement, mode);
     
    137137
    138138
    139   /**
     139    /**
    140140        @brief Activates / deactivates formationflight behaviour
    141141        @param form activate formflight if form is true
    142142    */
    143   void FormationController::formationflight(const bool form)
     143    void FormationController::formationflight(const bool form)
    144144    {
    145145        for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it)
     
    168168    }
    169169
    170   /**
     170    /**
    171171        @brief Get all masters to do a "specific master action"
    172172        @param action which action to perform (integer, so it can be called with a console command (tmp solution))
     
    198198    }
    199199
    200   /**
     200    /**
    201201        @brief Sets shooting behaviour of pawns.
    202202        @param passive if true, bots won't shoot.
     
    225225    }
    226226
    227   /**
     227    /**
    228228        @brief Sets maximal formation size
    229229        @param size maximal formation size.
     
    282282        Vector2 coord = get2DViewcoordinates(this->getControllableEntity()->getPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->getControllableEntity()->getOrientation() * WorldEntity::UP, target);
    283283        float distance = (target - this->getControllableEntity()->getPosition()).length();
    284                 if(coord.x < 0.0001 && coord.y < 0.0001)
    285                 {
    286                         // if the ship reaches a direction very close to the direct one, set it to the direct one
    287                         Vector3 v_temp = this->getControllableEntity()->getPosition();
    288                         Quaternion quat = v_temp.getRotationTo(target);
    289                         this->getControllableEntity()->rotate(quat);
    290                 }
     284        if(coord.x < 0.0001 && coord.y < 0.0001)
     285        {
     286            // if the ship reaches a direction very close to the direct one, set it to the direct one
     287            Vector3 v_temp = this->getControllableEntity()->getPosition();
     288            Quaternion quat = v_temp.getRotationTo(target);
     289            this->getControllableEntity()->rotate(quat);
     290        }
    291291
    292292        if(this->state_ == FREE)
     
    324324
    325325        if(this->state_ == SLAVE)
    326                 {
    327 
    328                         this->getControllableEntity()->rotateYaw(-2.0f * ROTATEFACTOR_MASTER * coord.x * 2);
    329                         this->getControllableEntity()->rotatePitch(2.0f * ROTATEFACTOR_MASTER * coord.y * 2);
    330 
    331                         if (distance < 300)
    332                         {
    333                                 if (bHasTargetOrientation_)
    334                                 {
    335                                         copyTargetOrientation();
    336                                 }
    337                                 if (distance < 100)
    338                                 { //linear speed reduction
    339                                         this->getControllableEntity()->moveFrontBack(distance/100.0f*0.4f*SPEED_MASTER);
    340 
    341                                 } else this->getControllableEntity()->moveFrontBack(1.2f*SPEED_MASTER);
    342 
    343                         } else {
    344                                 this->getControllableEntity()->moveFrontBack(1.2f*SPEED_MASTER + distance/300.0f);
    345                         }
    346                 }
     326        {
     327
     328            this->getControllableEntity()->rotateYaw(-2.0f * ROTATEFACTOR_MASTER * coord.x * 2);
     329            this->getControllableEntity()->rotatePitch(2.0f * ROTATEFACTOR_MASTER * coord.y * 2);
     330
     331            if (distance < 300)
     332            {
     333                if (bHasTargetOrientation_)
     334                {
     335                    copyTargetOrientation();
     336                }
     337                if (distance < 100)
     338                { //linear speed reduction
     339                    this->getControllableEntity()->moveFrontBack(distance/100.0f*0.4f*SPEED_MASTER);
     340                }
     341                else
     342                    this->getControllableEntity()->moveFrontBack(1.2f*SPEED_MASTER);
     343            }
     344            else
     345                this->getControllableEntity()->moveFrontBack(1.2f*SPEED_MASTER + distance/300.0f);
     346        }
    347347
    348348        if (distance < 10)
    349349        {
    350350            this->positionReached();
    351             bHasTargetOrientation_=false;
    352         }
    353     }
    354 
    355 
    356 
    357   void FormationController::moveToTargetPosition()
     351            bHasTargetOrientation_=false;
     352        }
     353    }
     354
     355
     356
     357    void FormationController::moveToTargetPosition()
    358358    {
    359359        this->moveToPosition(this->targetPosition_);
    360360    }
    361361
    362   //copy the Roll orientation of given Quaternion.
    363   void FormationController::copyOrientation(const Quaternion& orient)
     362    //copy the Roll orientation of given Quaternion.
     363    void FormationController::copyOrientation(const Quaternion& orient)
    364364    {
    365365        //roll angle difference in radian
     
    379379
    380380
    381    /**
     381    /**
    382382        @brief Unregisters a slave from its master. Initiated by a slave.
    383383    */
     
    469469        }
    470470    }
    471  /**
     471
     472    /**
    472473        @brief Commands the slaves of a master into a formation. Sufficiently fast not to be called within tick. Initiated by a master.
    473474    */
    474 
    475 void FormationController::commandSlaves()
     475    void FormationController::commandSlaves()
    476476    {
    477477        if(this->state_ != MASTER) return;
     
    487487        }
    488488        else
    489         // formation:
     489        // formation:
    490490        {
    491491            dest += 1.0f*orient*WorldEntity::BACK;
    492492            Vector3 pos = Vector3::ZERO;
    493                  bool left=true;
     493            bool left=true;
    494494            int i = 1;
    495495
     
    689689
    690690        if (specificMasterActionHoldCount_ == 0)
    691          {
     691        {
    692692            this->specificMasterAction_ = NONE;
    693693            this->searchNewTarget();
    694          }
    695         else specificMasterActionHoldCount_--;
     694        }
     695        else
     696            specificMasterActionHoldCount_--;
    696697    }
    697698
     
    717718    void FormationController::turn180()
    718719    {
    719             Vector2 coord = get2DViewdirection(this->getControllableEntity()->getPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->getControllableEntity()->getOrientation() * WorldEntity::UP, this->targetPosition_);
    720 
    721             this->getControllableEntity()->rotateYaw(-2.0f * sgn(coord.x) * coord.x*coord.x);
    722             this->getControllableEntity()->rotatePitch(2.0f * sgn(coord.y) * coord.y*coord.y);
    723 
    724             this->getControllableEntity()->moveFrontBack(SPEED_MASTER);
     720        Vector2 coord = get2DViewdirection(this->getControllableEntity()->getPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->getControllableEntity()->getOrientation() * WorldEntity::UP, this->targetPosition_);
     721
     722        this->getControllableEntity()->rotateYaw(-2.0f * sgn(coord.x) * coord.x*coord.x);
     723        this->getControllableEntity()->rotatePitch(2.0f * sgn(coord.y) * coord.y*coord.y);
     724
     725        this->getControllableEntity()->moveFrontBack(SPEED_MASTER);
    725726    }
    726727
     
    740741    void FormationController::spin()
    741742    {
    742             this->moveToTargetPosition();
    743             this->getControllableEntity()->rotateRoll(0.8f);
     743        this->moveToTargetPosition();
     744        this->getControllableEntity()->rotateRoll(0.8f);
    744745    }
    745746
     
    779780        if((humanPawn != NULL) && (allMasters.size() != 0))
    780781        {
    781                 float posHuman = humanPawn->getPosition().length();
    782                 float distance = 0.0f;
    783                 float minDistance = FLT_MAX;
    784                 int index = 0;
    785                 int i = 0;
    786 
    787                 for(std::vector<FormationController*>::iterator it = allMasters.begin(); it != allMasters.end(); it++, i++)
    788                     {
    789                         if (!FormationController::sameTeam((*it)->getControllableEntity(), humanPawn, (*it)->getGametype())) continue;
    790                         distance = posHuman - (*it)->getControllableEntity()->getPosition().length();
    791                         if(distance < minDistance) index = i;
    792                     }
    793                 allMasters[index]->followInit(humanPawn);
    794             }
    795 
    796     }
    797 
    798 
    799 
    800 
     782            float posHuman = humanPawn->getPosition().length();
     783            float distance = 0.0f;
     784            float minDistance = FLT_MAX;
     785            int index = 0;
     786            int i = 0;
     787
     788            for(std::vector<FormationController*>::iterator it = allMasters.begin(); it != allMasters.end(); it++, i++)
     789            {
     790                if (!FormationController::sameTeam((*it)->getControllableEntity(), humanPawn, (*it)->getGametype())) continue;
     791                distance = posHuman - (*it)->getControllableEntity()->getPosition().length();
     792                if(distance < minDistance) index = i;
     793            }
     794            allMasters[index]->followInit(humanPawn);
     795        }
     796    }
    801797
    802798    /**
     
    820816    }
    821817
    822    /**
     818    /**
    823819        @brief Master begins to follow a randomly chosen human player of the same team. Is a "specific master action".
    824820    */
     
    848844
    849845
    850   /**
     846    /**
    851847        @brief Master follows target with adjusted speed. Called within tick.
    852848    */
     
    860856
    861857
    862   void FormationController::setTargetPosition(const Vector3& target)
     858    void FormationController::setTargetPosition(const Vector3& target)
    863859    {
    864860        this->targetPosition_ = target;
     
    924920    }
    925921
    926   void FormationController::forgetTarget()
     922    void FormationController::forgetTarget()
    927923    {
    928924        this->target_ = 0;
     
    930926    }
    931927
    932    void FormationController::targetDied()
     928    void FormationController::targetDied()
    933929    {
    934930        this->forgetTarget();
     
    936932    }
    937933
    938   bool FormationController::sameTeam(ControllableEntity* entity1, ControllableEntity* entity2, Gametype* gametype)
     934    bool FormationController::sameTeam(ControllableEntity* entity1, ControllableEntity* entity2, Gametype* gametype)
    939935    {
    940936        if (entity1 == entity2)
  • code/branches/presentation2012merge/src/orxonox/gametypes/Mission.cc

    r9271 r9272  
    6363        {
    6464            this->missionAccomplished_ = false;
    65             this->end();
     65            this->end();
    6666        }
    6767    }
     
    7878    {
    7979        Gametype::end();
    80         /*if (this->missionAccomplished_)
     80        /*if (this->missionAccomplished_)
    8181            this->gtinfo_->sendAnnounceMessage("Mission accomplished!");
    82         else
     82        else
    8383            this->gtinfo_->sendAnnounceMessage("Mission failed!");
    84          * */
     84        */
    8585    }
    8686
  • code/branches/presentation2012merge/src/orxonox/infos/PlayerInfo.cc

    r9257 r9272  
    173173        this->changedControllableEntity();
    174174
    175                 RadarViewable* radarviewable = orxonox_cast<RadarViewable*>(entity);
     175        RadarViewable* radarviewable = orxonox_cast<RadarViewable*>(entity);
    176176        if (radarviewable != NULL)
    177177            radarviewable->setRadarName(this->getName());
  • code/branches/presentation2012merge/src/orxonox/interfaces/RadarViewable.h

    r9257 r9272  
    6161        virtual ~RadarViewable();
    6262
    63                 virtual void setRadarName(const std::string& name)
    64                         {
    65                                 if (this->radarName_ != name)
    66                                 {
    67                                         this->radarName_ = name;
    68                                         this->settingsChanged();
    69                                 }
    70                         }
    71                 const std::string& getRadarName() const
    72                         { return this->radarName_; }
     63        virtual void setRadarName(const std::string& name)
     64            {
     65                if (this->radarName_ != name)
     66                {
     67                    this->radarName_ = name;
     68                    this->settingsChanged();
     69                }
     70            }
     71        const std::string& getRadarName() const
     72            { return this->radarName_; }
    7373
    7474        inline void setRadarObjectCamouflage(float camouflage)
     
    163163        ColourValue radarObjectColour_;
    164164        float scale_;
    165                 std::string radarName_;
     165        std::string radarName_;
    166166    };
    167167}
  • code/branches/presentation2012merge/src/orxonox/worldentities/ControllableEntity.cc

    r9016 r9272  
    8787        this->setPriority( Priority::VeryHigh );
    8888        this->registerVariables();
    89         this->team_ = -1;
     89        this->team_ = -1;
    9090    }
    9191
  • code/branches/presentation2012merge/src/orxonox/worldentities/ControllableEntity.h

    r9255 r9272  
    164164            void setTargetInternal( uint32_t targetID );
    165165
    166             inline void setTeam(int team)
    167                 { this->team_ = team; }
    168             inline int getTeam() const
    169                 { return this->team_; }
     166            inline void setTeam(int team)
     167                { this->team_ = team; }
     168            inline int getTeam() const
     169                { return this->team_; }
    170170
    171171        protected:
     
    243243            WeakPtr<WorldEntity> target_;
    244244
    245             int team_ ; //<! teamnumber
     245            int team_ ; //<! teamnumber
    246246    };
    247247}
  • code/branches/presentation2012merge/src/orxonox/worldentities/pawns/Pawn.cc

    r9269 r9272  
    232232    {
    233233        //Applies multiplier given by the DamageBoost Pickup.
    234         Pawn *test = dynamic_cast<Pawn *>(originator);
    235         if( test != NULL )
    236         {
    237           damage *= originator->getDamageMultiplier();
    238         }
    239 
    240         if (this->getGametype() && this->getGametype()->allowPawnDamage(this, originator))
     234        Pawn *test = dynamic_cast<Pawn *>(originator);
     235        if( test != NULL )
     236        {
     237            damage *= originator->getDamageMultiplier();
     238        }
     239
     240        if (this->getGametype() && this->getGametype()->allowPawnDamage(this, originator))
    241241        {
    242242            if (shielddamage >= this->getShieldHealth())
  • code/branches/presentation2012merge/src/orxonox/worldentities/pawns/SpaceShip.cc

    r8892 r9272  
    133133    {
    134134        SetConfigValue(bInvertYAxis_, false).description("Set this to true for joystick-like mouse behaviour (mouse up = ship down).");
    135        
     135
    136136        SetConfigValueExternal(bEnableMotionBlur_, "GraphicsSettings", "enableMotionBlur", true)
    137137            .description("Enable or disable the motion blur effect when moving very fast")
     
    503503    void SpaceShip::resetCamera()
    504504    {
    505         if(this->hasLocalController() && this->hasHumanController())
    506         {
     505        if(this->hasLocalController() && this->hasHumanController())
     506        {
    507507            Camera *camera = this->getCamera();
    508508            if (camera == 0)
     
    514514            camera->setPosition(this->cameraOriginalPosition_);
    515515            camera->setOrientation(this->cameraOriginalOrientation_);
    516         }
     516        }
    517517    }
    518518
Note: See TracChangeset for help on using the changeset viewer.