Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 5, 2015, 10:47:51 PM (9 years ago)
Author:
landauf
Message:

use range-based for-loop where it makes sense (e.g. ObjectList)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v2/src/modules/jump/JumpProjectile.cc

    r10768 r10919  
    6969        Vector3 projectilePosition = getPosition();
    7070
    71         for (ObjectList<JumpEnemy>::iterator it = ObjectList<JumpEnemy>::begin(); it != ObjectList<JumpEnemy>::end(); ++it)
     71        for (JumpEnemy* enemy : ObjectList<JumpEnemy>())
    7272        {
    73             Vector3 enemyPosition = it->getPosition();
    74             float enemyWidth = it->getWidth();
    75             float enemyHeight = it->getHeight();
     73            Vector3 enemyPosition = enemy->getPosition();
     74            float enemyWidth = enemy->getWidth();
     75            float enemyHeight = enemy->getHeight();
    7676
    7777            if(projectilePosition.x > enemyPosition.x-enemyWidth && projectilePosition.x < enemyPosition.x+enemyWidth && projectilePosition.z > enemyPosition.z-enemyHeight && projectilePosition.z < enemyPosition.z+enemyHeight)
    7878            {
    79                 it->dead_ = true;
     79                enemy->dead_ = true;
    8080            }
    8181        }
Note: See TracChangeset for help on using the changeset viewer.