Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 4, 2015, 3:30:38 PM (9 years ago)
Author:
landauf
Message:

don't call srand()! this is already done by Core. also fixed some MSVC-warnings

Location:
code/branches/presentationFS15merge/src/modules
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentationFS15merge/src/modules/towerdefense/TowerDefense.cc

    r10615 r10621  
    431431        int helpnumber = 40 -(waves_);
    432432        if(helpnumber <= 0) {helpnumber =1;}
    433         float numSpaceships = std::abs((rand() % 100)*5*(helpnumber));
    434         float numEggs = std::abs((rand() % 100)*1*(waves_));
    435         float numUfos = std::abs((rand() % 100)*1.5*(0.5*(waves_))) ;
    436 
    437         float totalnumber = (numSpaceships + numEggs + numUfos)*1.3;
     433        float numSpaceships = std::abs((rand() % 100)*5.0f*(helpnumber));
     434        float numEggs = std::abs((rand() % 100)*1.0f*(waves_));
     435        float numUfos = std::abs((rand() % 100)*1.5f*(0.5f*(waves_))) ;
     436
     437        float totalnumber = (numSpaceships + numEggs + numUfos)*1.3f;
    438438
    439439        int newspaceships = (int)(maxspaceships* numSpaceships / totalnumber);
  • code/branches/presentationFS15merge/src/modules/towerdefense/TowerDefenseTower.cc

    r10615 r10621  
    6767            float reloadrate = getReloadRate();
    6868            float reloadwaittime = getReloadWaitTime();
    69             this->setDamageMultiplier((upgrade+1)*1.5);
     69            this->setDamageMultiplier((upgrade+1)*1.5f);
    7070            this->setRotationThrust(2*this->getRotationThrust());
    7171            reloadrate = 0.7f*reloadrate;
  • code/branches/presentationFS15merge/src/modules/weapons/projectiles/GravityBombField.cc

    r10619 r10621  
    6464        //Let the Bomb Modell in the centre rotate in a random direction.
    6565        Vector3 randomRotation;
    66         srand(time(NULL));
    67         randomRotation.x = rand();
    68         randomRotation.y = rand();
    69         randomRotation.y = rand();
     66        randomRotation.x = rnd();
     67        randomRotation.y = rnd();
     68        randomRotation.y = rnd();
    7069        randomRotation.normalise();
    7170        bombModel_->setAngularAcceleration(randomRotation*(PEAK_ANGULAR_VELOCITY/FORCE_FIELD_LIFETIME));
     
    114113                explosionCross_ = new ParticleEmitter(this->getContext());
    115114                explosionCross_->setSource("Orxonox/FieldExplosion");
    116                 explosionCross_->setOrientation(rand(), rand(), rand(), rand());
     115                explosionCross_->setOrientation(rnd(), rnd(), rnd(), rnd());
    117116                explosionCross_->setScale(0.7);
    118117                this->attach(explosionCross_);
Note: See TracChangeset for help on using the changeset viewer.