1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

PlayerState now stores all objects owned by player

This commit is contained in:
Ivan Savenko
2024-08-24 22:21:26 +00:00
parent 0fd9dbf240
commit a481f07daf
21 changed files with 184 additions and 113 deletions

View File

@@ -29,10 +29,10 @@ HighScoreParameter HighScore::prepareHighScores(const CGameState * gs, PlayerCol
param.townAmount = gs->howManyTowns(player);
param.usedCheat = gs->getPlayerState(player)->cheated;
param.hasGrail = false;
for(const CGHeroInstance * h : playerState->heroes)
for(const CGHeroInstance * h : playerState->getHeroes())
if(h->hasArt(ArtifactID::GRAIL))
param.hasGrail = true;
for(const CGTownInstance * t : playerState->towns)
for(const CGTownInstance * t : playerState->getTowns())
if(t->hasBuilt(BuildingID::GRAIL))
param.hasGrail = true;
param.allEnemiesDefeated = true;