Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 11083


Ignore:
Timestamp:
Jan 21, 2016, 1:59:04 PM (8 years ago)
Author:
muemart
Message:

Fix some clang-tidy warnings.
Also, Serialise.h was doing some C-style casts that ended up being const casts. I moved those const casts as close to the source as possible and changed the loadAndIncrease functions to not do that.

Location:
code/trunk/src
Files:
45 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/libraries/core/GUIManager.cc

    r11071 r11083  
    104104#include "util/OrxAssert.h"
    105105#include "util/output/BaseWriter.h"
     106#include "util/StringUtils.h"
     107#include "util/SubString.h"
    106108#include "config/ConfigValueIncludes.h"
    107109#include "Core.h"
  • code/trunk/src/libraries/core/class/SubclassIdentifier.h

    r11071 r11083  
    9292        public:
    9393            /// Constructor: Automaticaly assigns the Identifier of the given class.
    94             SubclassIdentifier()
     94            SubclassIdentifier() : identifier_(nullptr)
    9595            {
    9696                this->identifier_ = ClassIdentifier<T>::getIdentifier();
     
    9898
    9999            /// Constructor: Assigns the given Identifier.
    100             SubclassIdentifier(Identifier* identifier)
     100            SubclassIdentifier(Identifier* identifier) : identifier_(nullptr)
    101101            {
    102102                this->operator=(identifier);
     
    105105            /// Copyconstructor: Assigns the identifier of another SubclassIdentifier.
    106106            template <class O>
    107             SubclassIdentifier(const SubclassIdentifier<O>& identifier)
     107            SubclassIdentifier(const SubclassIdentifier<O>& identifier) : identifier_(nullptr)
    108108            {
    109109                this->operator=(identifier.getIdentifier());
  • code/trunk/src/libraries/core/input/KeyBinder.cc

    r11071 r11083  
    6767        for (unsigned int i = 0; i < KeyCode::numberOfKeys; i++)
    6868        {
    69             const std::string& keyname = KeyCode::ByString[i];
     69            const std::string keyname = KeyCode::ByString[i];
    7070            if (!keyname.empty())
    7171                keys_[i].name_ = std::string("Key") + keyname;
  • code/trunk/src/libraries/network/MasterServer.cc

    r11071 r11083  
    253253    /* convert to string */
    254254    std::string ip = std::string( addrconv );
     255    /* output debug info about the data that has come */
     256    helper_output_debug(event, addrconv);
    255257    /* delete addrconv */
    256258    if( addrconv ) free( addrconv );
     
    259261    char * packetdata = (char *)event->packet->data;
    260262
    261     /* output debug info about the data that has come */
    262     helper_output_debug( event, addrconv );
    263263
    264264    /* GAME SERVER OR CLIENT CONNECTION? */
     
    332332  {
    333333    /***** ENTER MAIN LOOP *****/
    334     ENetEvent *event = (ENetEvent *)calloc(sizeof(ENetEvent), sizeof(char));
     334    ENetEvent *event = (ENetEvent *)calloc(1, sizeof(ENetEvent));
    335335    if( event == nullptr )
    336336    {
  • code/trunk/src/libraries/network/packet/Gamestate.cc

    r11071 r11083  
    489489Gamestate* Gamestate::diffVariables(Gamestate *base)
    490490{
    491   assert(this && base); assert(data_ && base->data_);
     491  assert(base); assert(data_ && base->data_);
    492492  assert(!header_.isCompressed() && !base->header_.isCompressed());
    493493  assert(!header_.isDiffed());
  • code/trunk/src/libraries/network/packet/ServerInformation.cc

    r11071 r11083  
    5555      // Save ACK
    5656      uint8_t* temp = event->packet->data;
    57       char* ack = new char[strlen(LAN_DISCOVERY_ACK)+1];
     57      char* ack = nullptr;
    5858      loadAndIncrease((char*&)ack, temp);
    5959
     
    6464      // Save Server Name
    6565      loadAndIncrease(this->serverName_, temp);
     66      delete[] ack;
    6667    }
    6768
     
    7475    {
    7576      std::string payload = this->serverName_ + Ogre::StringConverter::toString(this->clientNumber_);
    76       uint32_t size = returnSize((char*&)LAN_DISCOVERY_ACK) + returnSize(payload);
     77      uint32_t size = returnSize(LAN_DISCOVERY_ACK) + returnSize(payload);
    7778      uint8_t* temp = new uint8_t[size];
    7879      uint8_t* temp2 = temp;
    79       saveAndIncrease((char*&)LAN_DISCOVERY_ACK, temp2);
     80      saveAndIncrease(LAN_DISCOVERY_ACK, temp2);
    8081      saveAndIncrease(payload, temp2);
    8182      ENetPacket* packet = enet_packet_create( temp, size, 0 );
  • code/trunk/src/libraries/util/Serialise.h

    r11071 r11083  
    4848    template <class T> inline uint32_t returnSize( const T& variable );
    4949    /** @brief loads the value of a variable out of the bytestream and increases the mem pointer */
    50     template <class T> inline void loadAndIncrease( const T& variable, uint8_t*& mem );
     50    template <class T> inline void loadAndIncrease( T& variable, uint8_t*& mem );
    5151    /** @brief saves the value of a variable into the bytestream and increases the mem pointer */
    5252    template <class T> inline void saveAndIncrease( const T& variable, uint8_t*& mem );
     
    5757  // =========== char*
    5858
    59   inline uint32_t returnSize( char*& variable )
     59  inline uint32_t returnSize(const char*& variable )
    6060  {
    6161    return strlen(variable)+1;
    6262  }
    6363
    64   inline void saveAndIncrease( char*& variable, uint8_t*& mem )
     64  inline void saveAndIncrease(const char*& variable, uint8_t*& mem )
    6565  {
    66     strcpy((char*)mem, variable);
    67     mem += returnSize(variable);
     66    uint32_t len = returnSize(variable);
     67    std::memcpy(mem, variable, len);
     68    mem += len;
    6869  }
    6970
     
    7273    if( variable )
    7374      delete variable;
    74     uint32_t len = strlen((char*)mem)+1;
     75    uint32_t len = returnSize((const char*&)mem);
    7576    variable = new char[len];
    76     strcpy((char*)variable, (char*)mem);
     77    std::memcpy(variable, mem, len);
    7778    mem += len;
    7879  }
     
    9293    }
    9394
    94     template <> inline void loadAndIncrease( const bool& variable, uint8_t*& mem )
     95    template <> inline void loadAndIncrease( bool& variable, uint8_t*& mem )
    9596    {
    9697        *(uint8_t*)( &variable ) = *static_cast<uint8_t*>(mem);
     
    116117    }
    117118
    118     template <> inline void loadAndIncrease( const char& variable, uint8_t*& mem )
     119    template <> inline void loadAndIncrease( char& variable, uint8_t*& mem )
    119120    {
    120121        *(uint8_t*)( &variable ) = *static_cast<uint8_t*>(mem);
     
    140141    }
    141142
    142     template <> inline void loadAndIncrease( const unsigned char& variable, uint8_t*& mem )
     143    template <> inline void loadAndIncrease( unsigned char& variable, uint8_t*& mem )
    143144    {
    144145        *(uint8_t*)( &variable ) = *static_cast<uint8_t*>(mem);
     
    164165    }
    165166
    166     template <> inline void loadAndIncrease( const short& variable, uint8_t*& mem )
     167    template <> inline void loadAndIncrease( short& variable, uint8_t*& mem )
    167168    {
    168169        *(short*)( &variable ) = *(int16_t*)(mem);
     
    188189    }
    189190
    190     template <> inline void loadAndIncrease( const unsigned short& variable, uint8_t*& mem )
     191    template <> inline void loadAndIncrease( unsigned short& variable, uint8_t*& mem )
    191192    {
    192193        *(unsigned short*)( &variable ) = *(uint16_t*)(mem);
     
    212213    }
    213214
    214     template <> inline void loadAndIncrease( const int& variable, uint8_t*& mem )
     215    template <> inline void loadAndIncrease( int& variable, uint8_t*& mem )
    215216    {
    216217        *(int *)( &variable ) = *(int32_t*)(mem);
     
    236237    }
    237238
    238     template <> inline void loadAndIncrease( const unsigned int& variable, uint8_t*& mem )
     239    template <> inline void loadAndIncrease( unsigned int& variable, uint8_t*& mem )
    239240    {
    240241        *(unsigned int*)( &variable ) = *(uint32_t*)(mem);
     
    260261    }
    261262
    262     template <> inline void loadAndIncrease( const long& variable, uint8_t*& mem )
     263    template <> inline void loadAndIncrease( long& variable, uint8_t*& mem )
    263264    {
    264265        *(long*)( &variable ) = *(int32_t*)(mem);
     
    284285    }
    285286
    286     template <> inline void loadAndIncrease( const unsigned long& variable, uint8_t*& mem )
     287    template <> inline void loadAndIncrease( unsigned long& variable, uint8_t*& mem )
    287288    {
    288289        *(unsigned long*)( &variable ) = *(uint32_t*)(mem);
     
    308309    }
    309310
    310     template <> inline void loadAndIncrease( const long long& variable, uint8_t*& mem )
     311    template <> inline void loadAndIncrease( long long& variable, uint8_t*& mem )
    311312    {
    312313        *(long long*)( &variable ) = *(int64_t*)(mem);
     
    332333    }
    333334
    334     template <> inline void loadAndIncrease( const unsigned long long& variable, uint8_t*& mem )
     335    template <> inline void loadAndIncrease( unsigned long long& variable, uint8_t*& mem )
    335336    {
    336337        *(unsigned long long*)( &variable ) = *(uint64_t*)(mem);
     
    356357    }
    357358
    358     template <> inline void loadAndIncrease( const float& variable, uint8_t*& mem )
     359    template <> inline void loadAndIncrease( float& variable, uint8_t*& mem )
    359360    {
    360361        *(uint32_t*)( &variable ) = *(uint32_t*)(mem);
     
    380381    }
    381382
    382     template <> inline void loadAndIncrease( const double& variable, uint8_t*& mem )
     383    template <> inline void loadAndIncrease( double& variable, uint8_t*& mem )
    383384    {
    384385        *(uint64_t*)( &variable ) = *(uint64_t*)(mem);
     
    404405    }
    405406
    406     template <> inline void loadAndIncrease( const long double& variable, uint8_t*& mem )
     407    template <> inline void loadAndIncrease( long double& variable, uint8_t*& mem )
    407408    {
    408409        double temp;
     
    438439    }
    439440
    440     template <> inline void loadAndIncrease( const std::string& variable, uint8_t*& mem )
     441    template <> inline void loadAndIncrease( std::string& variable, uint8_t*& mem )
    441442    {
    442443        *(std::string*)( &variable ) = (const char *)mem;
     
    464465    }
    465466
    466     template <> inline void loadAndIncrease( const Degree& variable, uint8_t*& mem )
     467    template <> inline void loadAndIncrease( Degree& variable, uint8_t*& mem )
    467468    {
    468469        Ogre::Real* r = (Ogre::Real*)mem;
     
    491492    }
    492493
    493     template <> inline void loadAndIncrease( const Radian& variable, uint8_t*& mem )
     494    template <> inline void loadAndIncrease( Radian& variable, uint8_t*& mem )
    494495    {
    495496        Ogre::Real* r = (Ogre::Real*)mem;
     
    517518    }
    518519
    519     template <> inline void loadAndIncrease( const Vector2& variable, uint8_t*& mem )
     520    template <> inline void loadAndIncrease( Vector2& variable, uint8_t*& mem )
    520521    {
    521522        loadAndIncrease( variable.x, mem );
     
    542543    }
    543544
    544     template <> inline void loadAndIncrease( const Vector3& variable, uint8_t*& mem )
     545    template <> inline void loadAndIncrease( Vector3& variable, uint8_t*& mem )
    545546    {
    546547        loadAndIncrease( variable.x, mem );
     
    570571    }
    571572
    572     template <> inline void loadAndIncrease( const Vector4& variable, uint8_t*& mem )
     573    template <> inline void loadAndIncrease( Vector4& variable, uint8_t*& mem )
    573574    {
    574575        loadAndIncrease( variable.w, mem );
     
    600601    }
    601602
    602     template <> inline void loadAndIncrease( const Quaternion& variable, uint8_t*& mem )
     603    template <> inline void loadAndIncrease( Quaternion& variable, uint8_t*& mem )
    603604    {
    604605        loadAndIncrease( variable.w, mem );
     
    630631    }
    631632
    632     template <> inline void loadAndIncrease( const ColourValue& variable, uint8_t*& mem )
     633    template <> inline void loadAndIncrease( ColourValue& variable, uint8_t*& mem )
    633634    {
    634635        loadAndIncrease( variable.r, mem );
     
    657658    }
    658659
    659     template <> inline void loadAndIncrease( const mbool& variable, uint8_t*& mem )
     660    template <> inline void loadAndIncrease( mbool& variable, uint8_t*& mem )
    660661    {
    661662        loadAndIncrease( (unsigned char&)((mbool&)variable).getMemory(), mem );
  • code/trunk/src/modules/gametypes/SpaceRaceController.cc

    r11071 r11083  
    397397    bool SpaceRaceController::vergleicheQuader(const Vector3& pointToPoint, const Vector3& groesse)
    398398    {
    399         if(abs(pointToPoint.x) < groesse.x)
     399        if(std::abs(pointToPoint.x) < groesse.x)
    400400            return true;
    401         if(abs(pointToPoint.y) < groesse.y)
     401        if(std::abs(pointToPoint.y) < groesse.y)
    402402            return true;
    403         if(abs(pointToPoint.z) < groesse.z)
     403        if(std::abs(pointToPoint.z) < groesse.z)
    404404            return true;
    405405        return false;
  • code/trunk/src/modules/hover/TimeHUD.cc

    r11071 r11083  
    8282        {
    8383            this->setCaption(getTimeString(this->time_));
     84            if (this->hoverGame_->getNumberOfFlags() == 0)
     85                setRunning(false);
    8486        }
    85         if(this->hoverGame_->getNumberOfFlags() == 0)
    86             setRunning(false);
    8787       
    8888    }
  • code/trunk/src/modules/invader/Invader.cc

    r11071 r11083  
    129129                newPawn->addTemplate("enemyinvader");
    130130            }
    131             newPawn->setPlayer(player);
     131            newPawn->setInvaderPlayer(player);
    132132            newPawn->level = level;
    133133            // spawn enemy at random points in front of player.
  • code/trunk/src/modules/invader/InvaderEnemy.cc

    r11071 r11083  
    5858        if (player != nullptr)
    5959        {
    60             float newZ = 2/(pow(abs(getPosition().x - player->getPosition().x) * 0.01f, 2) + 1) * (player->getPosition().z - getPosition().z);
     60            float newZ = 2/(pow(std::abs(getPosition().x - player->getPosition().x) * 0.01f, 2) + 1) * (player->getPosition().z - getPosition().z);
    6161            setVelocity(Vector3(1000.f - level * 100 , 0, newZ));
    6262        }
  • code/trunk/src/modules/invader/InvaderEnemy.h

    r11071 r11083  
    4949            virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) override;
    5050            virtual void damage(float damage, float healthdamage, float shielddamage, Pawn* originator, const btCollisionShape* cs) override;
    51             virtual void setPlayer(InvaderShip* player){this->player = player;}
     51            virtual void setInvaderPlayer(InvaderShip* player){this->player = player;}
    5252
    5353            int level;
  • code/trunk/src/modules/invader/InvaderEnemyShooter.cc

    r11071 r11083  
    6363            float distPlayer = player->getPosition().z - getPosition().z;
    6464            // orxout() << "i'm different!" << endl;
    65             float newZ = 2/(pow(abs(getPosition().x - player->getPosition().x) * 0.01f, 2) + 1) * distPlayer;
    66             setVelocity(Vector3(950 - abs(distPlayer), 0, newZ));
     65            float newZ = 2/(pow(std::abs(getPosition().x - player->getPosition().x) * 0.01f, 2) + 1) * distPlayer;
     66            setVelocity(Vector3(950 - std::abs(distPlayer), 0, newZ));
    6767        }
    6868        Pawn::tick(dt);
  • code/trunk/src/modules/objects/ForceField.cc

    r11071 r11083  
    6363        //Standard Values
    6464        this->setDirection(Vector3::ZERO);
    65         this->setVelocity(100);
     65        this->setFieldVelocity(100);
    6666        this->setDiameter(500);
    6767        this->setMassDiameter(0);   //! We allow point-masses
     
    8888        SUPER(ForceField, XMLPort, xmlelement, mode);
    8989
    90         XMLPortParam(ForceField, "velocity", setVelocity, getVelocity, xmlelement, mode).defaultValues(100);
     90        XMLPortParam(ForceField, "velocity", setFieldVelocity, getFieldVelocity, xmlelement, mode).defaultValues(100);
    9191        XMLPortParam(ForceField, "diameter", setDiameter, getDiameter, xmlelement, mode).defaultValues(500);
    9292        XMLPortParam(ForceField, "massDiameter", setMassDiameter, getMassDiameter, xmlelement, mode).defaultValues(0);
  • code/trunk/src/modules/objects/ForceField.h

    r11071 r11083  
    9898            @param vel The velocity to be set.
    9999            */
    100             inline void setVelocity(float vel)
     100            inline void setFieldVelocity(float vel)
    101101                { this->velocity_ = vel; }
    102102            /**
     
    104104            @return Returns the velocity of the ForceField.
    105105            */
    106             inline float getVelocity()
     106            inline float getFieldVelocity()
    107107                { return this->velocity_; }
    108108
  • code/trunk/src/modules/objects/SpaceBoundaries.cc

    r11071 r11083  
    221221                    }
    222222                }
    223                 if(/* humanItem &&*/ abs(this->maxDistance_ - distance) < this->showDistance_ )
     223                if(/* humanItem &&*/ std::abs(this->maxDistance_ - distance) < this->showDistance_ )
    224224                {
    225225                    this->displayBoundaries(currentPawn, 1.0f - fabs(this->maxDistance_ - distance) / this->showDistance_); // Show the boundary
  • code/trunk/src/modules/objects/triggers/DistanceTrigger.h

    r11071 r11083  
    9797            virtual ~DistanceTrigger();
    9898
    99             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); // Method for creating a DistanceTrigger object through XML.
     99            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; // Method for creating a DistanceTrigger object through XML.
    100100
    101101            void addTarget(const std::string& targets); // Add some target to the DistanceTrigger.
  • code/trunk/src/modules/objects/triggers/EventTrigger.h

    r11071 r11083  
    7373            virtual ~EventTrigger();
    7474
    75             virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode); // Creates an event port.
     75            virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode) override; // Creates an event port.
    7676
    7777            /**
  • code/trunk/src/modules/overlays/hud/ChatOverlay.cc

    r11071 r11083  
    7373        Timer* timer = new Timer();
    7474        this->timers_.insert(timer); // store the timer in a set to destroy it in the destructor
    75         const ExecutorPtr& executor = createExecutor(createFunctor(&ChatOverlay::dropMessage, this));
     75        const ExecutorPtr executor = createExecutor(createFunctor(&ChatOverlay::dropMessage, this));
    7676        executor->setDefaultValues(timer);
    7777        timer->setTimer(this->displayTime_, false, executor, true);
  • code/trunk/src/modules/pickup/items/ShrinkPickup.cc

    r11071 r11083  
    277277            {
    278278                Pawn* pawn = this->carrierToPawnHelper();
    279                 if(pawn == nullptr) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.
     279                if (pawn == nullptr) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.
     280                {
    280281                    this->Pickupable::destroy();
     282                    return;
     283                }
    281284
    282285                this->timeRemainig_ -= dt;
  • code/trunk/src/modules/pong/Pong.cc

    r11071 r11083  
    326326    PlayerInfo* Pong::getLeftPlayer() const
    327327    {
    328         if (this->bat_ != nullptr && this->bat_[0] != nullptr)
     328        if (this->bat_[0] != nullptr)
    329329            return this->bat_[0]->getPlayer();
    330330        else
     
    340340    PlayerInfo* Pong::getRightPlayer() const
    341341    {
    342         if (this->bat_ != nullptr && this->bat_[1] != nullptr)
     342        if (this->bat_[1] != nullptr)
    343343            return this->bat_[1]->getPlayer();
    344344        else
  • code/trunk/src/modules/questsystem/QuestListener.cc

    r11071 r11083  
    8181        XMLPortParam(QuestListener, "mode", setMode, getMode, xmlelement, mode);
    8282
    83         if(this->quest_ != nullptr)
     83        std::string questid;
     84
     85        if (this->quest_ != nullptr)
     86        {
    8487            this->quest_->addListener(this); // Adds the QuestListener to the Quests list of listeners.
    85 
    86         orxout(verbose, context::quests) << "QuestListener created for quest: {" << this->quest_->getId() << "} with mode '" << this->getMode() << "'." << endl;
     88            questid = this->quest_->getId();
     89        }
     90
     91        orxout(verbose, context::quests) << "QuestListener created for quest: {" << questid << "} with mode '" << this->getMode() << "'." << endl;
    8792    }
    8893
  • code/trunk/src/modules/questsystem/effects/ChangeQuestStatus.h

    r11071 r11083  
    6161            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; //!< Method for creating a ChangeQuestStatus object through XML.
    6262
    63             virtual bool invoke(PlayerInfo* player) = 0; //!< Invokes the QuestEffect.
    64 
    6563        protected:
    6664            /**
  • code/trunk/src/modules/tetris/Tetris.cc

    r11071 r11083  
    140140            const Vector3& currentStonePosition = someStone->getPosition(); //!< Saves the position of the currentStone
    141141
    142             if((position.x == currentStonePosition.x) && abs(position.y-currentStonePosition.y) < this->center_->getStoneSize())
     142            if((position.x == currentStonePosition.x) && std::abs(position.y-currentStonePosition.y) < this->center_->getStoneSize())
    143143                return false;
    144144        }
     
    222222        if(position.y < this->center_->getStoneSize()/2.0f) //!< If the stone has reached the bottom of the level
    223223        {
    224             float baseOffset = abs(stone->getPosition().y);
     224            float baseOffset = std::abs(stone->getPosition().y);
    225225            if (this->activeBrick_->getRotationCount() == 1 || this->activeBrick_->getRotationCount() == 3)
    226                 baseOffset = abs(stone->getPosition().x);
     226                baseOffset = std::abs(stone->getPosition().x);
    227227            float yOffset = baseOffset + this->center_->getStoneSize()/2.0f;//calculate offset
    228228            if(yOffset < 0) //catch brake-throughs
  • code/trunk/src/modules/tetris/TetrisBrick.cc

    r11071 r11083  
    213213        {
    214214            const Vector3& position = this->getPosition();
    215             Vector3 newPos = Vector3(position.x+value.x/abs(value.x)*this->size_, position.y, position.z);
     215            Vector3 newPos = Vector3(position.x+value.x/std::abs(value.x)*this->size_, position.y, position.z);
    216216            if(!this->isValidMove(newPos))
    217217                return;
  • code/trunk/src/modules/tetris/TetrisStone.cc

    r9667 r11083  
    9292        {
    9393            const Vector3& position = this->getPosition();
    94             Vector3 newPos = Vector3(position.x+value.x/abs(value.x)*this->size_, position.y, position.z);
     94            Vector3 newPos = Vector3(position.x+value.x/std::abs(value.x)*this->size_, position.y, position.z);
    9595            if(!this->tetris_->isValidMove(this, newPos))
    9696                return;
  • code/trunk/src/modules/towerdefense/TDCoordinate.cc

    r10629 r11083  
    6666        float tileScale = 100;
    6767
    68         Vector3 *coord = new Vector3();
    69         coord->x= (_x-8) * tileScale;
    70         coord->y= (_y-8) * tileScale;
    71         coord->z=0;
     68        Vector3 coord;
     69        coord.x= (_x-8) * tileScale;
     70        coord.y= (_y-8) * tileScale;
     71        coord.z=0;
    7272
    73         return *coord;
     73        return coord;
    7474    }
    7575}
  • code/trunk/src/modules/towerdefense/TowerDefense.cc

    r11071 r11083  
    377377    {       
    378378        TowerDefenseField* thisField = fields_[thisCoord->GetX()][thisCoord->GetY()];
    379         TDCoordinate* nextCoord = new TDCoordinate(0,0);
    380379
    381380        if (thisField->getType() != TowerDefenseFieldType::STREET && thisField->getType() != TowerDefenseFieldType::START)
     
    384383        }
    385384
     385        TDCoordinate* nextCoord = new TDCoordinate(0, 0);
     386
    386387        if (thisField->getAngle() == 0)
    387388        {
     
    406407        }
    407408
     409        delete nextCoord;
    408410        return nullptr;
    409411    }
  • code/trunk/src/modules/weapons/projectiles/GravityBombField.cc

    r11071 r11083  
    3434        fieldExploded_ = false;
    3535
    36         setVelocity(FORCE_SPHERE_START_STRENGTH);
     36        setFieldVelocity(FORCE_SPHERE_START_STRENGTH);
    3737        setDiameter(2*FORCE_SPHERE_START_RADIUS);
    3838        setMode(modeSphere_s);
     
    158158       
    159159        setDiameter(forceSphereRadius_*2);
    160         setVelocity(forceStrength_);
     160        setFieldVelocity(forceStrength_);
    161161        if(lifetime_>0) particleSphere_->setScale(forceSphereRadius_/FORCE_SPHERE_START_RADIUS);
    162162        bombModel_->setScale(modelScaling_);
  • code/trunk/src/orxonox/chat/ChatInputHandler.cc

    r11071 r11083  
    214214  {
    215215    /* sanity checks */
    216     if( !tocolor )
    217       orxout(internal_warning) << "Empty ListBoxTextItem given to "
    218         "ChatInputhandler::sub_setcolor()." << endl;
     216    if (!tocolor)
     217    {
     218        orxout(internal_warning) << "Empty ListBoxTextItem given to "
     219            "ChatInputhandler::sub_setcolor()." << endl;
     220        return;
     221    }
    219222
    220223    /* "hash" the name */
  • code/trunk/src/orxonox/controllers/ActionpointController.cc

    r11071 r11083  
    7474    void ActionpointController::tick(float dt)
    7575    {
    76         if (!this || !this->getControllableEntity() || !this->isActive())
     76        if (!this->getControllableEntity() || !this->isActive())
    7777            return;
    7878
     
    8686        }
    8787
    88         if (!this || !this->getControllableEntity())
    89             return;
    9088        //fly
    9189        if (this->bHasTargetPosition_)
     
    9896        }
    9997       
    100 
    101         if (!this || !this->getControllableEntity())
    102             return;
    10398        //don't fire rocket each tick
    10499        if (timeout_ <= 0)
     
    111106        }
    112107
    113         if (!this || !this->getControllableEntity())
    114             return;
    115108        //sometimes dodge, sometimes attack
    116109        if (this->ticks_ % 80 <= 10)
     
    123116        }
    124117
    125         if (!this || !this->getControllableEntity())
    126             return;
    127118        //fire if you can
    128119        if (this->bShooting_)
     
    140131    void ActionpointController::action()
    141132    {
    142         if (!this || !this->getControllableEntity() || !this->isActive())
     133        if (!this->getControllableEntity() || !this->isActive())
    143134            return;
    144135
     
    152143            this->startAttackingEnemiesThatAreClose();
    153144        }
    154         if (!this || !this->getControllableEntity())
    155             return;
    156145
    157146        //No action -> pop one from stack
     
    161150            if (this->parsedActionpoints_.empty() && this->loopActionpoints_.empty() && this->bDefaultFightAll_)
    162151            {
    163                 if (!this || !this->getControllableEntity())
    164                     return;
    165152                Point p = { Action::FIGHTALL, "", Vector3::ZERO, false };
    166153                this->parsedActionpoints_.push_back (p);
    167154            }
    168             if (!this || !this->getControllableEntity())
    169                 return;
    170155            this->executeActionpoint();
    171             if (!this || !this->getControllableEntity())
    172                 return;
    173156            this->bTakenOver_ = false;
    174157        }
    175         if (!this || !this->getControllableEntity())
    176             return;
    177158
    178159        //Action fightall -> fight till nobody alive
     
    185166                if (newTarget)
    186167                {
    187                     if (!this || !this->getControllableEntity())
    188                         return;
    189168                    this->setAction (Action::FIGHTALL, newTarget);
    190169                }
    191170                else
    192171                {
    193                     if (!this || !this->getControllableEntity())
    194                         return;
    195172                    this->nextActionpoint();
    196                     if (!this || !this->getControllableEntity())
    197                         return;
    198173                    this->executeActionpoint();
    199174   
     
    207182            {
    208183                //----find a target----
    209                 ControllableEntity* newTarget = this->closestTarget(); 
    210                 if (!this || !this->getControllableEntity())
    211                     return; 
     184                ControllableEntity* newTarget = this->closestTarget();
    212185                if (newTarget &&
    213186                        CommonController::distance (this->getControllableEntity(), newTarget) < this->attackRange_)
    214187                {
    215                     if (!this || !this->getControllableEntity())
    216                         return;
    217188                    this->setAction (Action::FIGHT, newTarget);
    218189                }
    219190                else
    220191                {
    221                     if (!this || !this->getControllableEntity())
    222                         return;
    223192                    this->nextActionpoint();
    224                     if (!this || !this->getControllableEntity())
    225                         return;
    226193                    this->executeActionpoint();
    227194                }
     
    235202                {
    236203                    ControllableEntity* newTarget = this->closestTarget();
    237                     if (!this || !this->getControllableEntity())
    238                         return;
    239204                    if (newTarget &&
    240205                        CommonController::distance (this->getControllableEntity(), newTarget) < this->attackRange_)
    241206                    {
    242                         if (!this || !this->getControllableEntity())
    243                             return;
    244207                        this->setAction (Action::FIGHT, newTarget);
    245208                    }
    246209                    else
    247210                    {
    248                         if (!this || !this->getControllableEntity())
    249                             return;
    250211                        this->nextActionpoint();
    251                         if (!this || !this->getControllableEntity())
    252                             return;
    253212                        this->executeActionpoint();
    254213                    }
     
    260219            if (this->squaredDistanceToTarget() <= this->squaredaccuracy_)
    261220            {
    262                 if (!this || !this->getControllableEntity())
    263                     return;
    264221                this->nextActionpoint();   
    265                 if (!this || !this->getControllableEntity())
    266                     return;
    267222                this->executeActionpoint();
    268223            }
     
    272227            if (!this->getProtect())
    273228            {
    274                 if (!this || !this->getControllableEntity())
    275                     return;
    276229                this->nextActionpoint();
    277                 if (!this || !this->getControllableEntity())
    278                     return;
    279230                this->executeActionpoint();
    280231            }
    281             if (!this || !this->getControllableEntity())
    282                 return;
    283232            this->stayNearProtect();
    284233        }
    285234        else if (this->action_ == Action::ATTACK)
    286235        {   
    287             if (!this || !this->getControllableEntity())
    288                 return;
    289236            if (!this->hasTarget())
    290237            {
    291                 if (!this || !this->getControllableEntity())
    292                     return;
    293238                this->nextActionpoint();
    294                 if (!this || !this->getControllableEntity())
    295                     return;
    296239                this->executeActionpoint();
    297240            }
     
    408351    void ActionpointController::setAction (Action action, ControllableEntity* target)
    409352    {
    410         if (!this || !this->getControllableEntity())
     353        if (!this->getControllableEntity())
    411354            return;
    412355        this->action_ = action;
     
    425368    void ActionpointController::setAction (Action action, const Vector3& target)
    426369    {
    427         if (!this || !this->getControllableEntity())
     370        if (!this->getControllableEntity())
    428371            return;
    429372        this->action_ = action;
     
    436379    void ActionpointController::setAction (Action action, const Vector3& target,  const Quaternion& orient )
    437380    {
    438         if (!this || !this->getControllableEntity())
     381        if (!this->getControllableEntity())
    439382            return;
    440383        this->action_ = action;
     
    454397    void ActionpointController::executeActionpoint()
    455398    {
    456         if (!this || !this->getControllableEntity())
     399        if (!this->getControllableEntity())
    457400            return;
    458401
     
    473416        else
    474417        {
    475             if (!this || !this->getControllableEntity())
    476                 return;
    477 
    478418            this->setTarget(nullptr);
    479419            this->setTargetPosition(this->getControllableEntity()->getWorldPosition());
     
    481421            return;
    482422        }
    483         if (!this || !this->getControllableEntity())
    484             return;
    485423        if (!this->bLoop_ && this->parsedActionpoints_.back().inLoop)
    486424        {
    487425            //MOVES all points that are in loop to a loop vector
    488426            this->fillLoop();
    489             if (!this || !this->getControllableEntity())
    490                 return;
    491427            this->bLoop_ = true;
    492428            executeActionpoint();
    493429            return;
    494430        }
    495         if (!this || !this->getControllableEntity())
    496             return;
    497431        this->setAction (p.action);
    498         if (!this || !this->getControllableEntity())
    499             return;
    500432
    501433        switch (this->action_)
     
    508440                for (Pawn* pawn : ObjectList<Pawn>())
    509441                {
    510                     if (!this || !this->getControllableEntity())
    511                         return;
    512442                    if (CommonController::getName(pawn) == targetName)
    513443                    {
     
    520450            {
    521451                this->setTargetPosition( p.position );
    522                 if (!this || !this->getControllableEntity())
    523                     return;
    524452                if (this->squaredDistanceToTarget() <= this->squaredaccuracy_)
    525453                {
    526                     if (!this || !this->getControllableEntity())
    527                         return;
    528454                    this->nextActionpoint();
    529                     if (!this || !this->getControllableEntity())
    530                         return;
    531455                    this->executeActionpoint();
    532456                }
     
    535459            case Action::PROTECT:
    536460            {
    537                 if (!this || !this->getControllableEntity())
    538                     return;
    539461
    540462                std::string protectName = p.name;
     
    582504                    if (CommonController::getName(pawn) == targetName)
    583505                    {
    584                         if (!this || !this->getControllableEntity())
    585                             return;
    586506                        this->setTarget (static_cast<ControllableEntity*>(pawn));
    587507                    }
     
    590510                {
    591511                    this->nextActionpoint();
    592                     if (!this || !this->getControllableEntity())
    593                         return;
    594512                    this->executeActionpoint();
    595513                }
     
    604522    void ActionpointController::stayNearProtect()
    605523    {
    606         if (!this || !this->getControllableEntity())
     524        if (!this->getControllableEntity())
    607525            return;
    608526
     
    626544    void ActionpointController::nextActionpoint()
    627545    {
    628         if (!this || !this->getControllableEntity())
    629             return;
    630546        if (this->bLoop_)
    631547        {
     
    653569    void ActionpointController::moveBackToTop()
    654570    {
    655         if (!this || !this->getControllableEntity())
     571        if (!this->getControllableEntity())
    656572            return;
    657573
     
    684600    void ActionpointController::takeActionpoints (const std::vector<Point>& vector, const std::vector<Point>& loop, bool b)
    685601    {
    686         if (!this || !this->getControllableEntity())
     602        if (!this->getControllableEntity())
    687603            return;
    688604        this->parsedActionpoints_ = vector;
    689         if (!this || !this->getControllableEntity())
    690             return;
    691605        this->loopActionpoints_ = loop;
    692606        this->bLoop_ = b;
     
    701615    Pawn* ActionpointController::closestTarget()
    702616    {
    703         if (!this || !this->getControllableEntity())
     617        if (!this->getControllableEntity())
    704618            return nullptr;
    705619
     
    709623        for (Pawn* pawn : ObjectList<Pawn>())
    710624        {
    711             if (!this || !this->getControllableEntity())
    712                 return nullptr;
    713625            if ( CommonController::sameTeam (this->getControllableEntity(), static_cast<ControllableEntity*>(pawn), gt) )
    714626                continue;
     
    730642    void ActionpointController::startAttackingEnemiesThatAreClose()
    731643    {
    732         if (!this || !this->getControllableEntity())
     644        if (!this->getControllableEntity())
    733645            return;
    734646       
    735647        if (!this->target_ || (this->target_ && CommonController::distance (this->getControllableEntity(), this->target_) > this->attackRange_))
    736648        {
    737             if (!this || !this->getControllableEntity())
    738                 return;
    739649            Pawn* newTarget = this->closestTarget();
    740650            if ( newTarget &&
     
    742652                    <= this->attackRange_ )
    743653            {
    744                 if (!this || !this->getControllableEntity())
    745                     return;
    746654                this->setTarget(newTarget);
    747655                if (this->bLoop_ && !this->bPatrolling_)
  • code/trunk/src/orxonox/controllers/DivisionController.cc

    r11071 r11083  
    5757    void DivisionController::action()
    5858    {   
    59         if (!this || !this->getControllableEntity() || !this->isActive())
     59        if (!this->getControllableEntity() || !this->isActive())
    6060            return;
    6161       
    6262        ActionpointController::action();
    63         if (!this || !this->getControllableEntity())
    64             return;
    6563        if (!(this->parsedActionpoints_.empty() && this->loopActionpoints_.empty()))
    6664        {
  • code/trunk/src/orxonox/controllers/FightingController.cc

    r11071 r11083  
    5858    void FightingController::lookAtTarget(float dt)
    5959    {
    60         if (!this || !this->getControllableEntity())
     60        if (!this->getControllableEntity())
    6161            return;
    6262        ControllableEntity* entity = this->getControllableEntity();
     
    124124        Vector3 diffUnit = diffVector/diffLength;
    125125
    126         if (!this || !this->getControllableEntity())
    127             return;
    128 
    129126        //too far? well, come closer then
    130127        if (diffLength > this->attackRange_)
     
    142139            this->bKeepFormation_ = false;
    143140
    144             if (!this || !this->getControllableEntity())
    145                 return;
    146141            if (!this->bDodge_)
    147142            {
     
    217212    float FightingController::squaredDistanceToTarget()  const
    218213    {
    219         if (!this || !this->getControllableEntity())
     214        if (!this->getControllableEntity())
    220215            return 0;
    221216        if (!this->target_ || !this->getControllableEntity())
     
    237232    Pawn* FightingController::closestTarget() const
    238233    {
    239         if (!this || !this->getControllableEntity())
     234        if (!this->getControllableEntity())
    240235            return nullptr;
    241236
  • code/trunk/src/orxonox/controllers/ScriptController.cc

    r11071 r11083  
    227227          {
    228228            // Specify the axis
    229             Vector3* a;
     229            Vector3 a;
    230230              switch ((int) currentEvent.d) {
    231231                case 3:
    232                   a = new Vector3(this->currentEvent.v1.x + this->currentEvent.e*cos(2*math::pi*dl),
     232                  a = Vector3(this->currentEvent.v1.x + this->currentEvent.e*cos(2*math::pi*dl),
    233233                                  this->currentEvent.v1.y + this->currentEvent.e*sin(2*math::pi*dl),
    234234                                  this->currentEvent.v1.z);
    235235                break;
    236236                case 2:
    237                   a = new Vector3(this->currentEvent.v1.x + this->currentEvent.e*sin(2*math::pi*dl),
     237                  a = Vector3(this->currentEvent.v1.x + this->currentEvent.e*sin(2*math::pi*dl),
    238238                                  this->currentEvent.v1.y,
    239239                                  this->currentEvent.v1.z + this->currentEvent.e*cos(2*math::pi*dl));
    240240                break;
    241241                case 1:
    242                   a = new Vector3(this->currentEvent.v1.x,
     242                  a = Vector3(this->currentEvent.v1.x,
    243243                                  this->currentEvent.v1.y + this->currentEvent.e*sin(2*math::pi*dl),
    244244                                  this->currentEvent.v1.z + this->currentEvent.e*cos(2*math::pi*dl));
     
    246246              }
    247247
    248             this->entity_->setPosition(*a);
     248            this->entity_->setPosition(a);
    249249
    250250            /* Look at the specified position */
  • code/trunk/src/orxonox/controllers/SectionController.cc

    r11071 r11083  
    5959    void SectionController::action()
    6060    {
    61         if (!this || !this->getControllableEntity() || !this->isActive())
     61        if (!this->getControllableEntity() || !this->isActive())
    6262            return;
    6363
     
    6666        {
    6767            ActionpointController* newDivisionLeader = findNewDivisionLeader();
    68             if (!this || !this->getControllableEntity())
    69                 return;
    7068
    7169            this->myDivisionLeader_ = newDivisionLeader;
     
    7876        {
    7977            ActionpointController::action();
    80             if (!this || !this->getControllableEntity())
    81                 return;
    8278            if (!(this->parsedActionpoints_.empty() && this->loopActionpoints_.empty()))
    8379            {
     
    9894            else if (!this->myDivisionLeader_->bKeepFormation_)
    9995            {
    100                 if (!this || !this->getControllableEntity())
    101                     return;
    10296
    10397                if (!this->hasTarget())
     
    121115        if (action == Action::FIGHT || action == Action::FIGHTALL || action == Action::ATTACK)
    122116        {
    123             Pawn* target;
     117            Pawn* target = nullptr;
    124118            //----if he has a target----
    125119            if (this->myDivisionLeader_->hasTarget())
  • code/trunk/src/orxonox/controllers/WingmanController.cc

    r11071 r11083  
    5858    void WingmanController::action()
    5959    {
    60         if (!this || !this->getControllableEntity() || !this->isActive())
     60        if (!this->getControllableEntity() || !this->isActive())
    6161            return;
    6262        //----If no leader, find one----
     
    6464        {
    6565            ActionpointController* newLeader = (findNewLeader());
    66             if (!this || !this->getControllableEntity())
    67                 return;
    6866
    6967            this->myLeader_ = newLeader;
     
    9290            else if (!this->myLeader_->bKeepFormation_)
    9391            {
    94                 if (!this || !this->getControllableEntity())
    95                     return;
    9692
    9793                if (!this->hasTarget())
  • code/trunk/src/orxonox/gametypes/LastManStanding.cc

    r11071 r11083  
    8888                if (it->first->getClientID()== NETWORK_PEER_ID_UNKNOWN)
    8989                    return true;
    90                 const std::string& message = ""; // resets Camper-Warning-message
     90                const std::string message = ""; // resets Camper-Warning-message
    9191                this->gtinfo_->sendFadingMessage(message,it->first->getClientID());
    9292            }
     
    195195            if (it->first->getClientID()== NETWORK_PEER_ID_UNKNOWN)
    196196                return;
    197             const std::string& message = ""; // resets Camper-Warning-message
     197            const std::string message = ""; // resets Camper-Warning-message
    198198            this->gtinfo_->sendFadingMessage(message,it->first->getClientID());
    199199        }
     
    262262                        if (mapEntry.first->getClientID()== NETWORK_PEER_ID_UNKNOWN)
    263263                            return;
    264                         const std::string& message = ""; // resets Camper-Warning-message
     264                        const std::string message = ""; // resets Camper-Warning-message
    265265                        this->gtinfo_->sendFadingMessage(message,mapEntry.first->getClientID());
    266266                    }
     
    270270                    if (mapEntry.first->getClientID()== NETWORK_PEER_ID_UNKNOWN)
    271271                        continue;
    272                     const std::string& message = "Camper Warning! Don't forget to shoot.";
     272                    const std::string message = "Camper Warning! Don't forget to shoot.";
    273273                    this->gtinfo_->sendFadingMessage(message,mapEntry.first->getClientID());
    274274                }
  • code/trunk/src/orxonox/gametypes/LastTeamStanding.cc

    r11071 r11083  
    136136                if (it->first->getClientID()== NETWORK_PEER_ID_UNKNOWN)
    137137                    return true;
    138                 const std::string& message = ""; // resets Camper-Warning-message
     138                const std::string message = ""; // resets Camper-Warning-message
    139139                this->gtinfo_->sendFadingMessage(message,it->first->getClientID());
    140140            }
     
    170170            if (it->first->getClientID()== NETWORK_PEER_ID_UNKNOWN)
    171171                return;
    172             const std::string& message = ""; // resets Camper-Warning-message
     172            const std::string message = ""; // resets Camper-Warning-message
    173173            this->gtinfo_->sendFadingMessage(message,it->first->getClientID());
    174174        }
     
    209209                        if (mapEntry.first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
    210210                            return;
    211                         const std::string& message = ""; // resets Camper-Warning-message
     211                        const std::string message = ""; // resets Camper-Warning-message
    212212                        this->gtinfo_->sendFadingMessage(message, mapEntry.first->getClientID());
    213213                    }
     
    217217                  if (mapEntry.first->getClientID()== NETWORK_PEER_ID_UNKNOWN)
    218218                        continue;
    219                     const std::string& message = "Camper Warning! Don't forget to shoot.";
     219                    const std::string message = "Camper Warning! Don't forget to shoot.";
    220220                    this->gtinfo_->sendFadingMessage(message, mapEntry.first->getClientID());
    221221                }
  • code/trunk/src/orxonox/graphics/LensFlare.cc

    r11080 r11083  
    3434#include "LensFlare.h"
    3535
     36#include "core/CoreIncludes.h"
    3637#include "core/XMLPort.h"
    3738#include "graphics/Billboard.h"
    3839#include "CameraManager.h"
     40#include "Camera.h"
    3941#include "RenderQueueListener.h"
     42#include "Scene.h"
    4043
    4144#include <OgreSphere.h>
    4245#include <OgreRenderWindow.h>
     46#include <OgreCamera.h>
    4347
    4448namespace orxonox
  • code/trunk/src/orxonox/graphics/LensFlare.h

    r11080 r11083  
    4141#include "core/GraphicsManager.h"
    4242#include "util/Math.h"
     43#include "tools/interfaces/Tickable.h"
    4344#include "worldentities/StaticEntity.h"
    4445#include "graphics/Billboard.h"
  • code/trunk/src/orxonox/weaponsystem/Munition.cc

    r11071 r11083  
    544544        if (bUseReloadTime && munition->reloadTime_ > 0 && munition->deployment_ != MunitionDeployment::Stack)
    545545        {
    546             const ExecutorPtr& executor = createExecutor(createFunctor(&Magazine::loaded, this));
     546            const ExecutorPtr executor = createExecutor(createFunctor(&Magazine::loaded, this));
    547547            executor->setDefaultValues(munition);
    548548
  • code/trunk/src/orxonox/worldentities/StaticEntity.cc

    r11071 r11083  
    5454    void StaticEntity::registerVariables()
    5555    {
    56         registerVariable(this->getPosition(),    VariableDirection::ToClient, new NetworkCallback<StaticEntity>(this, &StaticEntity::positionChanged));
    57         registerVariable(this->getOrientation(), VariableDirection::ToClient, new NetworkCallback<StaticEntity>(this, &StaticEntity::orientationChanged));
     56        // Ugly const casts, but are valid because position and orientation are not actually const
     57        registerVariable(const_cast<Vector3&>(this->getPosition()),    VariableDirection::ToClient, new NetworkCallback<StaticEntity>(this, &StaticEntity::positionChanged));
     58        registerVariable(const_cast<Quaternion&>(this->getOrientation()), VariableDirection::ToClient, new NetworkCallback<StaticEntity>(this, &StaticEntity::orientationChanged));
    5859    }
    5960
  • code/trunk/src/orxonox/worldentities/WorldEntity.cc

    r11071 r11083  
    190190        registerVariable(this->bVisible_,       VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::changedVisibility));
    191191
    192         registerVariable(this->getScale3D(),    VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::scaleChanged));
     192        // Ugly const cast, but is valid because the scale is not actually const
     193        registerVariable(const_cast<Vector3&>(this->getScale3D()),    VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::scaleChanged));
    193194
    194195        // Physics stuff
  • code/trunk/src/orxonox/worldentities/pawns/FpsPlayer.h

    r11071 r11083  
    4646            virtual ~FpsPlayer();
    4747
    48             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    49             virtual void tick(float dt);
     48            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
     49            virtual void tick(float dt) override;
    5050            void registerVariables();
    5151            void setConfigValues();
    5252
    53             virtual void moveFrontBack(const Vector2& value);
    54             virtual void moveRightLeft(const Vector2& value);
    55             virtual void moveUpDown(const Vector2& value);
     53            virtual void moveFrontBack(const Vector2& value) override;
     54            virtual void moveRightLeft(const Vector2& value) override;
     55            virtual void moveUpDown(const Vector2& value) override;
    5656
    57             virtual void rotateYaw(const Vector2& value);
    58             virtual void rotatePitch(const Vector2& value);
    59             virtual void rotateRoll(const Vector2& value);
     57            virtual void rotateYaw(const Vector2& value) override;
     58            virtual void rotatePitch(const Vector2& value) override;
     59            virtual void rotateRoll(const Vector2& value) override;
    6060
    6161
     
    6565                { return this->meshSrc_; }
    6666
    67             void boost(bool bBoost); //acctually jump
     67            void boost(bool bBoost) override; //actually jump
    6868
    6969            virtual void fire();
     
    7171            virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) override;
    7272
    73             virtual void addedWeaponPack(WeaponPack* wPack);
     73            virtual void addedWeaponPack(WeaponPack* wPack) override;
    7474
    7575        protected:
    76             virtual void setPlayer(PlayerInfo* player);
    77             virtual void startLocalHumanControl();
     76            virtual void setPlayer(PlayerInfo* player) override;
     77            virtual void startLocalHumanControl() override;
    7878            bool bInvertYAxis_;
    7979
     
    8989
    9090        private:
    91             virtual bool isCollisionTypeLegal(WorldEntity::CollisionType type) const;
     91            virtual bool isCollisionTypeLegal(WorldEntity::CollisionType type) const override;
    9292            float speed_;
    9393
  • code/trunk/src/orxonox/worldentities/pawns/SpaceShip.cc

    r11071 r11083  
    235235
    236236        // This function call adds a lift to the ship when it is rotating to make it's movement more "realistic" and enhance the feeling.
    237         if (this->getLocalVelocity().z < 0 && abs(this->getLocalVelocity().z) < stallSpeed_)
    238             this->moveRightLeft(-lift_ / 5.0f * value * sqrt(abs(this->getLocalVelocity().z)));
     237        if (this->getLocalVelocity().z < 0 && std::abs(this->getLocalVelocity().z) < stallSpeed_)
     238            this->moveRightLeft(-lift_ / 5.0f * value * sqrt(std::abs(this->getLocalVelocity().z)));
    239239    }
    240240
     
    257257
    258258        // This function call adds a lift to the ship when it is pitching to make it's movement more "realistic" and enhance the feeling.
    259         if (this->getLocalVelocity().z < 0 && abs(this->getLocalVelocity().z) < stallSpeed_)
    260             this->moveUpDown(lift_ / 5.0f * pitch * sqrt(abs(this->getLocalVelocity().z)));
     259        if (this->getLocalVelocity().z < 0 && std::abs(this->getLocalVelocity().z) < stallSpeed_)
     260            this->moveUpDown(lift_ / 5.0f * pitch * sqrt(std::abs(this->getLocalVelocity().z)));
    261261    }
    262262
     
    505505            this->shakeDt_ += dt;
    506506
    507             float frequency = this->shakeFrequency_ * (square(abs(this->getLocalVelocity().z)));
     507            float frequency = this->shakeFrequency_ * (square(std::abs(this->getLocalVelocity().z)));
    508508
    509509            if (this->shakeDt_ >= 1.0f/frequency)
Note: See TracChangeset for help on using the changeset viewer.