Page MenuHomeWildfire Games

Fix GetTerritoryPercentage when changing number of players
Needs ReviewPublic

Authored by Angen on Jul 5 2019, 9:02 PM.

Details

Reviewers
None
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Summary

Error:
We check if player > m_TerritoryCellCounts.size(), but m_TerritoryCellCounts.size() == number of players and we use player as index
Plus we are recomputing territories after we check bounds what if we remove player can lead to out of bounds exception

Run Atlas in debug mode and lower number of players to 1 using arrow key or mouse wheel

Test Plan

Run Atlas in debug mode and lower number of players to 1 using arrow key or mouse wheel

Diff Detail

Repository
rP 0 A.D. Public Repository
Branch
/ps/trunk
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 8205
Build 13370: Vulcan BuildJenkins
Build 13369: arc lint + arc unit

Event Timeline

Angen created this revision.Jul 5 2019, 9:02 PM
Owners added a subscriber: Restricted Owners Package.Jul 5 2019, 9:02 PM
Angen added inline comments.Jul 5 2019, 9:05 PM
source/simulation2/components/CCmpTerritoryManager.cpp
584

we probably should check against number of players in game and if it is not out of scope then let to recompute territories

Vulcan added a comment.Jul 5 2019, 9:06 PM

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...

source/simulation2/components/CCmpTerritoryManager.cpp
|   1| /*·Copyright·(C)·2018·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2018"
Executing section JS...
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/differential/1911/display/redirect

wraitii added a reviewer: Restricted Owners Package.Jul 11 2019, 3:04 PM