| 1311 | } |
| 1312 | |
| 1313 | void GameMap::playerIsFighting(Player* player, Tile* tile) |
| 1314 | { |
| 1315 | if (player == nullptr) |
| 1316 | return; |
| 1317 | |
| 1318 | // No need to check for inactive players |
| 1319 | if (player->getSeat() == nullptr) |
| 1320 | return; |
| 1321 | |
| 1322 | // Get every player's allies |
| 1323 | for (Player* ally : mPlayers) |
| 1324 | { |
| 1325 | // No need to warn AI about music |
| 1326 | if (!ally || !ally->getIsHuman()) |
| 1327 | continue; |
| 1328 | |
| 1329 | if (ally->getSeat() == nullptr || !ally->getSeat()->isAlliedSeat(player->getSeat())) |
| 1330 | continue; |
| 1331 | |
| 1332 | // Warn the ally about the battle |
| 1333 | ally->notifyTeamFighting(player, tile); |
| 1334 | } |
| 1335 | } |
| 1336 | |
| 1337 | std::list<Tile*> GameMap::findBestPath(const Creature* creature, Tile* tileStart, const std::vector<Tile*> possibleDests, |
| 1338 | Tile*& chosenTile) |
no test coverage detected