Commit 94adf49c authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

Use explicit brackets in expression with && and ||

GIT_SILENT
parent 0b30c989
......@@ -637,13 +637,13 @@ void MyMainView::moveShips()
config.gamespeed);
if(!playerIsAi&&playerKeyPressed[i][PlayerKeyRight]
|| playerIsAi&&ai[i]->rotateRight())
if ((!playerIsAi && playerKeyPressed[i][PlayerKeyRight]) ||
(playerIsAi && ai[i]->rotateRight()))
ship[i]->rotateRight(config.rotationEnergyNeed,
config.rotationSpeed);
if(!playerIsAi&&playerKeyPressed[i][PlayerKeyLeft]
|| playerIsAi&&ai[i]->rotateLeft())
if (!(playerIsAi && playerKeyPressed[i][PlayerKeyLeft]) ||
(playerIsAi && ai[i]->rotateLeft()))
ship[i]->rotateLeft(config.rotationEnergyNeed,
config.rotationSpeed);
......@@ -653,8 +653,8 @@ void MyMainView::moveShips()
nf = 0;
nx=cos(nr);
ny=sin(nr);
if ( ((!playerIsAi && playerKeyPressed[i][PlayerKeyAcc])
|| playerIsAi&&ai[i]->accelerate())
if (((!playerIsAi && playerKeyPressed[i][PlayerKeyAcc]) ||
(playerIsAi && ai[i]->accelerate()))
&& (en>config.energyNeed) )
{
en-=config.energyNeed;
......@@ -678,8 +678,8 @@ void MyMainView::moveShips()
ship[i]->forward(config.gamespeed);
//Bullets and Mines
if(!playerIsAi&&playerKeyPressed[i][PlayerKeyShot]
||playerIsAi&&ai[i]->shootBullet())
if ((!playerIsAi && playerKeyPressed[i][PlayerKeyShot]) ||
(playerIsAi && ai[i]->shootBullet()))
{
if((en>config.shotEnergyNeed) && (!ship[i]->reloadsBullet()))
{
......@@ -706,8 +706,8 @@ void MyMainView::moveShips()
}
}
}
if(!Options::playerIsAi(i)&&playerKeyPressed[i][PlayerKeyMine]
|| Options::playerIsAi(i)&&ai[i]->layMine())
if ((!Options::playerIsAi(i) && playerKeyPressed[i][PlayerKeyMine]) ||
(Options::playerIsAi(i) && ai[i]->layMine()))
{
if((en>config.mineEnergyNeed) && (!ship[i]->reloadsMine()))
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment