Ticket #3525: t3525_always_compute_territory_v1.patch
File t3525_always_compute_territory_v1.patch, 753 bytes (added by , 9 years ago) |
---|
-
source/simulation2/components/CCmpTerritoryManager.cpp
std::vector<STerritoryBoundary> CCmpTerr 535 535 u8 CCmpTerritoryManager::GetTerritoryPercentage(player_id_t player) 536 536 { 537 537 if (player <= 0 || (size_t)player > m_TerritoryCellCounts.size()) 538 538 return 0; 539 539 540 if (m_TerritoryTotalPassableCellCount == 0) 541 CalculateTerritories(); 540 CalculateTerritories(); 542 541 543 542 if (m_TerritoryTotalPassableCellCount == 0) 544 543 return 0; 545 544 546 545 u8 percentage = (m_TerritoryCellCounts[player] * 100) / m_TerritoryTotalPassableCellCount;