Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9277


Ignore:
Timestamp:
Jun 4, 2012, 9:40:54 PM (12 years ago)
Author:
landauf
Message:

small cleanup of damage multiplier: added 'const' to getter and removed unnecessary dynamic_cast

Location:
code/branches/presentation2012merge/src/orxonox/worldentities/pawns
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2012merge/src/orxonox/worldentities/pawns/Pawn.cc

    r9272 r9277  
    231231    void Pawn::damage(float damage, float healthdamage, float shielddamage, Pawn* originator)
    232232    {
    233         //Applies multiplier given by the DamageBoost Pickup.
    234         Pawn *test = dynamic_cast<Pawn *>(originator);
    235         if( test != NULL )
    236         {
    237             damage *= originator->getDamageMultiplier();
    238         }
     233        // Applies multiplier given by the DamageBoost Pickup.
     234        damage *= originator->getDamageMultiplier();
    239235
    240236        if (this->getGametype() && this->getGametype()->allowPawnDamage(this, originator))
  • code/branches/presentation2012merge/src/orxonox/worldentities/pawns/Pawn.h

    r9269 r9277  
    165165            inline void setDamageMultiplier(float multiplier)
    166166                { this->damageMultiplier_ = multiplier; }
    167             inline float getDamageMultiplier()
     167            inline float getDamageMultiplier() const
    168168                { return this->damageMultiplier_; }
    169169
     
    210210            float maxShieldHealth_;
    211211            float initialShieldHealth_;
    212             float shieldAbsorption_; // Has to be between 0 and 1
     212            float shieldAbsorption_; ///< Has to be between 0 and 1
    213213            float reloadRate_;
    214214            float reloadWaitTime_;
    215215            float reloadWaitCountdown_;
    216216
    217             // Modifier
    218             float damageMultiplier_; // Used by the Damage Boost Pickup.
     217            float damageMultiplier_; ///< Used by the Damage Boost Pickup.
    219218
    220219            WeakPtr<Pawn> lastHitOriginator_;
Note: See TracChangeset for help on using the changeset viewer.