forked from 0ad/0ad
Add check for non-passable (likely water-only) maps to territory percentage calculation.
Patch by s0600204. Fixes #3407. This was SVN commit r17002.
This commit is contained in:
parent
7842aa0468
commit
fc051d94cc
@ -540,7 +540,9 @@ u8 CCmpTerritoryManager::GetTerritoryPercentage(player_id_t player)
|
||||
if (m_TerritoryTotalPassableCellCount == 0)
|
||||
CalculateTerritories();
|
||||
|
||||
ENSURE(m_TerritoryTotalPassableCellCount > 0);
|
||||
if (m_TerritoryTotalPassableCellCount == 0)
|
||||
return 0;
|
||||
|
||||
u8 percentage = (m_TerritoryCellCounts[player] * 100) / m_TerritoryTotalPassableCellCount;
|
||||
ENSURE(percentage <= 100);
|
||||
return percentage;
|
||||
|
Loading…
Reference in New Issue
Block a user