Only illuminate what you can see (fix bug that illuminated allies in campaign).

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9205 4a71c877-e1ca-e34f-864e-861f7616d084
master
Guangcong Luo 2010-01-14 16:34:37 +00:00 committed by Git SVN Gateway
parent 393617583f
commit 168ba7d12e
1 changed files with 5 additions and 6 deletions

View File

@ -432,22 +432,21 @@ extern bool fireOnLocation(unsigned int x, unsigned int y);
static inline bool hasSensorOnTile(MAPTILE *psTile, int player)
{
int k;
bool seen = false;
if (psTile->watchers[selectedPlayer] == 0)
{
if (game.alliance == ALLIANCES_TEAMS)
if (game.type != CAMPAIGN && game.alliance == ALLIANCES_TEAMS)
{
// Check if an ally can provide us with vision on this tile
for (k = 0; k < MAX_PLAYERS; k++)
for (k = 0; k < MAX_PLAYERS; k++)
{
if (psTile->watchers[k] > 0 && aiCheckAlliances(k, selectedPlayer))
{
seen = true;
return true;
}
}
}
return seen;
return false;
}
return true;
}