few optimization and find aim for towers

This commit is contained in:
2010-08-29 11:43:14 +04:00
parent ea1a559525
commit 8f9294c405
14 changed files with 310 additions and 156 deletions

View File

@@ -88,7 +88,7 @@ bool Map::addTowerOnMap(int playerId, QPoint pos)
Cells[pos.x()][pos.y()]=PlayerTower-playerId;
return true;
}
if (Cells[pos.x()][pos.y()]==PlayerAlien+playerId)
if (Cells[pos.x()][pos.y()]==AlienPath+playerId)
{
Cells[pos.x()][pos.y()]=PlayerTower-playerId;
bool ok=true;
@@ -98,7 +98,7 @@ bool Map::addTowerOnMap(int playerId, QPoint pos)
qDebug()<<"ok="<<ok;
if (!ok)
{
Cells[pos.x()][pos.y()]=PlayerAlien+playerId;
Cells[pos.x()][pos.y()]=AlienPath+playerId;
return false;
}
//Cells[pos.x()][pos.y()]=PlayerTower-playerId;
@@ -110,7 +110,7 @@ bool Map::addTowerOnMap(int playerId, QPoint pos)
qDebug() << *pathOK;
if (!pathOK)
{
Cells[pos.x()][pos.y()]=PlayerAlien+playerId;
Cells[pos.x()][pos.y()]=AlienPath+playerId;
emit recreateAlienPath(pathOK);
return false;
}