no return in void methods
This commit is contained in:
parent
b2be14ca33
commit
3ea6a02d95
|
@ -736,23 +736,23 @@ void Ai::sendScoutPatrol(){
|
||||||
bool megaResourceAttack=(aiInterface->getControlType() == ctCpuMega || aiInterface->getControlType() == ctNetworkCpuMega)
|
bool megaResourceAttack=(aiInterface->getControlType() == ctCpuMega || aiInterface->getControlType() == ctNetworkCpuMega)
|
||||||
&& random.randRange(0, 1) == 1;
|
&& random.randRange(0, 1) == 1;
|
||||||
|
|
||||||
std::vector<Vec2i> warningEnemyList = aiInterface->getEnemyWarningPositionList();
|
// std::vector<Vec2i> warningEnemyList = aiInterface->getEnemyWarningPositionList();
|
||||||
if(warningEnemyList.empty() == false) {
|
// if(warningEnemyList.empty() == false) {
|
||||||
// Randomly check the enemy warning location list
|
// // Randomly check the enemy warning location list
|
||||||
if(random.randRange(0, 1) == 1) {
|
// if(random.randRange(0, 1) == 1) {
|
||||||
//for(int i = warningEnemyList.size() - 1; i <= 0; --i) {
|
// //for(int i = warningEnemyList.size() - 1; i <= 0; --i) {
|
||||||
|
//
|
||||||
// randomly pick a location from the location list
|
// // randomly pick a location from the location list
|
||||||
int i = random.randRange(0, warningEnemyList.size() - 1);
|
// int i = random.randRange(0, warningEnemyList.size() - 1);
|
||||||
|
//
|
||||||
Vec2i &checkPos = warningEnemyList[i];
|
// Vec2i &checkPos = warningEnemyList[i];
|
||||||
pos = checkPos;
|
// pos = checkPos;
|
||||||
possibleTargetFound = true;
|
// possibleTargetFound = true;
|
||||||
aiInterface->removeEnemyWarningPositionFromList(checkPos);
|
// aiInterface->removeEnemyWarningPositionFromList(checkPos);
|
||||||
// break;
|
// // break;
|
||||||
//}
|
// //}
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
if(possibleTargetFound == false && (megaResourceAttack || ultraResourceAttack)) {
|
if(possibleTargetFound == false && (megaResourceAttack || ultraResourceAttack)) {
|
||||||
Map *map= aiInterface->getMap();
|
Map *map= aiInterface->getMap();
|
||||||
|
|
||||||
|
@ -794,6 +794,22 @@ void Ai::sendScoutPatrol(){
|
||||||
//else printf("is outside map\n");
|
//else printf("is outside map\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::vector<Vec2i> warningEnemyList = aiInterface->getEnemyWarningPositionList();
|
||||||
|
if( (possibleTargetFound == false) && (warningEnemyList.empty() == false)) {
|
||||||
|
for(int i = warningEnemyList.size() - 1; i <= 0; --i) {
|
||||||
|
Vec2i &checkPos = warningEnemyList[i];
|
||||||
|
if (random.randRange(0, 1) == 1 ) {
|
||||||
|
pos = checkPos;
|
||||||
|
possibleTargetFound = true;
|
||||||
|
warningEnemyList.clear();
|
||||||
|
} else {
|
||||||
|
aiInterface->removeEnemyWarningPositionFromList(checkPos);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(possibleTargetFound == false){
|
if(possibleTargetFound == false){
|
||||||
startLoc= (startLoc + 1) % aiInterface->getMapMaxPlayers();
|
startLoc= (startLoc + 1) % aiInterface->getMapMaxPlayers();
|
||||||
pos= aiInterface->getStartLocation(startLoc);
|
pos= aiInterface->getStartLocation(startLoc);
|
||||||
|
|
|
@ -1496,7 +1496,7 @@ void ScriptManager::setUnitPosition(int unitId, Vec2i pos) {
|
||||||
void ScriptManager::addCellMarker(Vec2i pos, int factionIndex, const string ¬e, const string &textureFile) {
|
void ScriptManager::addCellMarker(Vec2i pos, int factionIndex, const string ¬e, const string &textureFile) {
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugLUA).enabled) SystemFlags::OutputDebug(SystemFlags::debugLUA,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugLUA).enabled) SystemFlags::OutputDebug(SystemFlags::debugLUA,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
ScriptManager_STREFLOP_Wrapper streflopWrapper;
|
ScriptManager_STREFLOP_Wrapper streflopWrapper;
|
||||||
return world->addCellMarker(pos,factionIndex, note, textureFile);
|
world->addCellMarker(pos,factionIndex, note, textureFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScriptManager::removeCellMarker(Vec2i pos, int factionIndex) {
|
void ScriptManager::removeCellMarker(Vec2i pos, int factionIndex) {
|
||||||
|
@ -1508,7 +1508,7 @@ void ScriptManager::removeCellMarker(Vec2i pos, int factionIndex) {
|
||||||
void ScriptManager::showMarker(Vec2i pos, int factionIndex, const string ¬e, const string &textureFile, int flashCount) {
|
void ScriptManager::showMarker(Vec2i pos, int factionIndex, const string ¬e, const string &textureFile, int flashCount) {
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugLUA).enabled) SystemFlags::OutputDebug(SystemFlags::debugLUA,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugLUA).enabled) SystemFlags::OutputDebug(SystemFlags::debugLUA,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
ScriptManager_STREFLOP_Wrapper streflopWrapper;
|
ScriptManager_STREFLOP_Wrapper streflopWrapper;
|
||||||
return world->showMarker(pos,factionIndex, note, textureFile, flashCount);
|
world->showMarker(pos,factionIndex, note, textureFile, flashCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
int ScriptManager::getIsUnitAlive(int unitId) {
|
int ScriptManager::getIsUnitAlive(int unitId) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user