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/modules/pickup/items/HealthPickup.cc

    r9667 r11071  
    7777        this->health_ = 0.0f;
    7878        this->healthRate_ = 0.0f;
    79         this->healthType_ = pickupHealthType::limited;
     79        this->healthType_ = PickupHealthType::limited;
    8080        this->maxHealthSave_ = 0.0f;
    8181        this->maxHealthOverwrite_ = 0.0f;
     
    114114        {
    115115            Pawn* pawn = this->carrierToPawnHelper();
    116             if(pawn == NULL) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.
     116            if(pawn == nullptr) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.
    117117                this->Pickupable::destroy();
    118118
     
    127127            switch(this->getHealthType())
    128128            {
    129                 case pickupHealthType::permanent:
     129                case PickupHealthType::permanent:
    130130                    if(pawn->getMaxHealth() < fullHealth)
    131131                        pawn->setMaxHealth(fullHealth);
    132                 case pickupHealthType::limited:
     132                case PickupHealthType::limited:
    133133                    pawn->addHealth(health);
    134134                    break;
    135                 case pickupHealthType::temporary:
     135                case PickupHealthType::temporary:
    136136                    if(pawn->getMaxHealth() > fullHealth)
    137137                    {
     
    168168            {
    169169                Pawn* pawn = this->carrierToPawnHelper();
    170                 if(pawn == NULL) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.
     170                if(pawn == nullptr) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.
    171171                    this->Pickupable::destroy();
    172172
     
    174174                switch(this->getHealthType())
    175175                {
    176                     case pickupHealthType::permanent:
     176                    case PickupHealthType::permanent:
    177177                        health = pawn->getHealth()+this->getHealth();
    178178                        if(pawn->getMaxHealth() < health)
    179179                            pawn->setMaxHealth(health);
    180                     case pickupHealthType::limited:
     180                    case PickupHealthType::limited:
    181181                        pawn->addHealth(this->getHealth());
    182182                        break;
    183                     case pickupHealthType::temporary:
     183                    case PickupHealthType::temporary:
    184184                        health = pawn->getHealth()+this->getHealth();
    185185                        if(pawn->getMaxHealth() < health)
     
    201201        else
    202202        {
    203             if(this->getHealthType() == pickupHealthType::temporary)
     203            if(this->getHealthType() == PickupHealthType::temporary)
    204204            {
    205205                PickupCarrier* carrier = this->getCarrier();
    206206                Pawn* pawn = orxonox_cast<Pawn*>(carrier);
    207207
    208                 if(pawn == NULL)
     208                if(pawn == nullptr)
    209209                {
    210210                    orxout(internal_error, context::pickups) << "Something went horribly wrong in Health Pickup. PickupCarrier is '" << carrier->getIdentifier()->getName() << "' instead of Pawn." << endl;
     
    233233        Helper to transform the PickupCarrier to a Pawn, and throw an error message if the conversion fails.
    234234    @return
    235         A pointer to the Pawn, or NULL if the conversion failed.
     235        A pointer to the Pawn, or nullptr if the conversion failed.
    236236    */
    237237    Pawn* HealthPickup::carrierToPawnHelper(void)
     
    240240        Pawn* pawn = orxonox_cast<Pawn*>(carrier);
    241241
    242         if(pawn == NULL)
     242        if(pawn == nullptr)
    243243            orxout(internal_error, context::pickups) << "Invalid PickupCarrier in HealthPickup." << endl;
    244244
     
    256256        switch(this->getHealthType())
    257257        {
    258             case pickupHealthType::limited:
     258            case PickupHealthType::limited:
    259259                return HealthPickup::healthTypeLimited_s;
    260             case pickupHealthType::temporary:
     260            case PickupHealthType::temporary:
    261261                return HealthPickup::healthTypeTemporary_s;
    262             case pickupHealthType::permanent:
     262            case PickupHealthType::permanent:
    263263                return HealthPickup::healthTypePermanent_s;
    264264            default:
     
    308308    {
    309309        if(type == HealthPickup::healthTypeLimited_s)
    310             this->setHealthType(pickupHealthType::limited);
     310            this->setHealthType(PickupHealthType::limited);
    311311        else if(type == HealthPickup::healthTypeTemporary_s)
    312             this->setHealthType(pickupHealthType::temporary);
     312            this->setHealthType(PickupHealthType::temporary);
    313313        else if(type == HealthPickup::healthTypePermanent_s)
    314             this->setHealthType(pickupHealthType::permanent);
     314            this->setHealthType(PickupHealthType::permanent);
    315315        else
    316316            orxout(internal_error, context::pickups) << "Invalid healthType '" << type << "' in HealthPickup." << endl;
Note: See TracChangeset for help on using the changeset viewer.