MCPcopy Create free account
hub / github.com/OpenDungeons/OpenDungeons / playerIsFighting

Method playerIsFighting

source/gamemap/GameMap.cpp:1313–1335  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1311}
1312
1313void 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
1337std::list<Tile*> GameMap::findBestPath(const Creature* creature, Tile* tileStart, const std::vector<Tile*> possibleDests,
1338 Tile*& chosenTile)

Callers 2

notifyFightPlayerMethod · 0.80
takeDamageMethod · 0.80

Calls 4

getIsHumanMethod · 0.80
isAlliedSeatMethod · 0.80
notifyTeamFightingMethod · 0.80
getSeatMethod · 0.45

Tested by

no test coverage detected