| 1914 | } |
| 1915 | |
| 1916 | bool AlienBAIState::validTarget(BattleUnit *unit, bool assessDanger, bool includeCivs) const |
| 1917 | { |
| 1918 | // ignore units that are dead/unconscious |
| 1919 | if (unit->isOut() || |
| 1920 | // they must be units that we "know" about |
| 1921 | _intelligence < unit->getTurnsSinceSpotted() || |
| 1922 | // they haven't been grenaded |
| 1923 | (assessDanger && unit->getTile()->getDangerous()) || |
| 1924 | // and they mustn't be on our side |
| 1925 | unit->getFaction() == FACTION_HOSTILE) |
| 1926 | { |
| 1927 | return false; |
| 1928 | } |
| 1929 | |
| 1930 | if (includeCivs) |
| 1931 | { |
| 1932 | return true; |
| 1933 | } |
| 1934 | |
| 1935 | return unit->getFaction() == FACTION_PLAYER; |
| 1936 | } |
| 1937 | } |
nothing calls this directly
no test coverage detected