[Orxonox-commit 4093] r8764 - code/branches/ai2/src/orxonox/controllers
jo at orxonox.net
jo at orxonox.net
Mon Jul 18 23:07:05 CEST 2011
Author: jo
Date: 2011-07-18 23:07:05 +0200 (Mon, 18 Jul 2011)
New Revision: 8764
Modified:
code/branches/ai2/src/orxonox/controllers/ArtificialController.cc
Log:
Got the bug.
Modified: code/branches/ai2/src/orxonox/controllers/ArtificialController.cc
===================================================================
--- code/branches/ai2/src/orxonox/controllers/ArtificialController.cc 2011-07-18 20:59:35 UTC (rev 8763)
+++ code/branches/ai2/src/orxonox/controllers/ArtificialController.cc 2011-07-18 21:07:05 UTC (rev 8764)
@@ -1045,11 +1045,11 @@
{
int firemode;
float random = rnd(1);//
- if (this->isCloseAtTarget(130) && (firemode = getFiremode("LightningGun"))>-1 )
+ if (this->isCloseAtTarget(130) && (firemode = getFiremode("LightningGun")) > -1 )
{//LENSFLARE: short range weapon
this->getControllableEntity()->fire(firemode); //ai uses lens flare if they're close enough to the target
}
- else if( this->isCloseAtTarget(400) && (random < this->botlevel_) && (firemode = getFiremode("RocketFire")>-1))
+ else if( this->isCloseAtTarget(400) && (random < this->botlevel_) && (firemode = getFiremode("RocketFire")) > -1 )
{//ROCKET: mid range weapon
this->mode_ = ROCKET; //Vector-implementation: mode_.push_back(ROCKET);
this->getControllableEntity()->fire(firemode); //launch rocket
@@ -1063,7 +1063,7 @@
else
this->timeout_ = 4.0f; //TODO: find better default value
}
- else if ((firemode = getFiremode("HsW01")>-1)) //LASER: default weapon
+ else if ((firemode = getFiremode("HsW01")) > -1 ) //LASER: default weapon
this->getControllableEntity()->fire(firemode);
}
}
More information about the Orxonox-commit
mailing list