Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 21, 2016, 1:59:04 PM (9 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/modules/invader
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • 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);
Note: See TracChangeset for help on using the changeset viewer.