Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 17, 2016, 10:29:21 PM (8 years ago)
Author:
landauf
Message:

merged branch cpp11_v3 back to trunk

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/orxonox/worldentities/pawns/Pawn.cc

    r11052 r11071  
    7777        this->shieldRechargeWaitCountdown_ = 0;
    7878
    79         this->lastHitOriginator_ = 0;
     79        this->lastHitOriginator_ = nullptr;
    8080
    8181        // set damage multiplier to default value 1, meaning nominal damage
     
    8686        this->aimPosition_ = Vector3::ZERO;
    8787
    88         //this->explosionPartList_ = NULL;
     88        //this->explosionPartList_ = nullptr;
    8989
    9090        if (GameMode::isMaster())
     
    9494        }
    9595        else
    96             this->weaponSystem_ = 0;
     96            this->weaponSystem_ = nullptr;
    9797
    9898        this->setRadarObjectColour(ColourValue::Red);
    99         this->setRadarObjectShape(RadarViewable::Dot);
     99        this->setRadarObjectShape(RadarViewable::Shape::Dot);
    100100
    101101        this->registerVariables();
     
    112112        else
    113113        {
    114             this->explosionSound_ = 0;
     114            this->explosionSound_ = nullptr;
    115115        }
    116116    }
     
    373373                    {
    374374                        // delete the AIController // <-- TODO: delete? nothing is deleted here... should we delete the controller?
    375                         slave->setControllableEntity(0);
     375                        slave->setControllableEntity(nullptr);
    376376
    377377                        // set a new master within the formation
     
    468468            return this->weaponSystem_->getWeaponSlot(index);
    469469        else
    470             return 0;
     470            return nullptr;
    471471    }
    472472
     
    482482            return this->weaponSystem_->getWeaponSet(index);
    483483        else
    484             return 0;
     484            return nullptr;
    485485    }
    486486
     
    510510            return this->weaponSystem_->getWeaponPack(index);
    511511        else
    512             return 0;
    513     }
    514 
    515     std::vector<WeaponPack *> * Pawn::getAllWeaponPacks()
    516     {
    517         if (this->weaponSystem_)
    518             return this->weaponSystem_->getAllWeaponPacks();
    519         else
    520             return 0;       
     512            return nullptr;
    521513    }
    522514
     
    531523    Munition* Pawn::getMunitionXML() const
    532524    {
    533         return NULL;
     525        return nullptr;
    534526    }
    535527
     
    541533        }
    542534
    543         return NULL;
     535        return nullptr;
    544536    }
    545537
     
    564556    bool Pawn::hasSlaves()
    565557    {
    566         for (ObjectList<FormationController>::iterator it =
    567              ObjectList<FormationController>::begin();
    568              it != ObjectList<FormationController>::end(); ++it )
     558        for (FormationController* controller : ObjectList<FormationController>())
    569559        {
    570560            // checks if the pawn's controller has a slave
    571             if (this->hasHumanController() && it->getMaster() == this->getPlayer()->getController())
     561            if (this->hasHumanController() && controller->getMaster() == this->getPlayer()->getController())
    572562                return true;
    573563        }
     
    577567    // A function that returns a slave of the pawn's controller
    578568    Controller* Pawn::getSlave(){
    579         for (ObjectList<FormationController>::iterator it =
    580                 ObjectList<FormationController>::begin();
    581                 it != ObjectList<FormationController>::end(); ++it )
    582         {
    583             if (this->hasHumanController() && it->getMaster() == this->getPlayer()->getController())
    584                 return it->getController();
    585         }
    586         return 0;
     569        for (FormationController* controller : ObjectList<FormationController>())
     570        {
     571            if (this->hasHumanController() && controller->getMaster() == this->getPlayer()->getController())
     572                return controller->getController();
     573        }
     574        return nullptr;
    587575    }
    588576
Note: See TracChangeset for help on using the changeset viewer.