few optimization and find aim for towers
This commit is contained in:
6
map.cpp
6
map.cpp
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user