AI players belonging to the same team should respond to the attack alarm.
Rationale:
A human player is allowed to see his ally's locations and he can make a choice to help out the AI units under attack if it helps the team's cause. Similarly the AI units must respond to the attack alarm if the attacked unit is an ally (AI or human).
Pros:
* Game play is now more consistent - it will now appear as if the AI can also see the mini map just a human player can.
* Allies must respond to any units in distress
Cons:
* A human player can just laze around while AI does all the work (however, when I made the code change and played, the opposite AI team is, as you might expect, doubly powerful so to speak... so it appears to even out rather well).
Here is my code change to achieve this:
Index: source/glest_game/ai/ai.cpp
===================================================================
--- source/glest_game/ai/ai.cpp (revision 2152)
+++ source/glest_game/ai/ai.cpp (working copy)
@@ -625,7 +625,7 @@
if(map->isInside(pos) && map->isInsideSurface(map->toSurfCoords(pos))) {
if(pos != unitPos) {
Unit *adjacentUnit = map->getCell(pos)->getUnit(unit->getCurrField());
- if(adjacentUnit != NULL && adjacentUnit->getFactionIndex() == unit->getFactionIndex()) {
+ if(adjacentUnit != NULL && aiInterface->isAlly(adjacentUnit) /*Sojo: adjacentUnit->getFactionIndex() == unit->getFactionIndex()*/) {
if(adjacentUnit->getType()->isMobile() && adjacentUnit->getPath() != NULL) {
//signalAdjacentUnits.push_back(adjacentUnit);
float dist = unitPos.dist(adjacentUnit->getPos());