1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Removed most of non-const static fields in lib. Reduced header includes.

This commit is contained in:
Ivan Savenko
2024-01-09 16:43:36 +02:00
parent a15366f5a5
commit e67e4430ba
49 changed files with 139 additions and 116 deletions

View File

@@ -16,6 +16,8 @@
#include "gameState/TavernHeroesPool.h"
#include "gameState/QuestInfo.h"
#include "mapObjects/CGHeroInstance.h"
#include "mapObjects/CGTownInstance.h"
#include "mapObjects/MiscObjects.h"
#include "networkPacks/ArtifactLocation.h"
#include "CGeneralTextHandler.h"
#include "StartInfo.h" // for StartInfo
@@ -791,7 +793,7 @@ int CPlayerSpecificInfoCallback::getHeroSerial(const CGHeroInstance * hero, bool
int3 CPlayerSpecificInfoCallback::getGrailPos( double *outKnownRatio )
{
if (!getPlayerID() || CGObelisk::obeliskCount == 0)
if (!getPlayerID() || gs->map->obeliskCount == 0)
{
*outKnownRatio = 0.0;
}
@@ -799,10 +801,10 @@ int3 CPlayerSpecificInfoCallback::getGrailPos( double *outKnownRatio )
{
TeamID t = gs->getPlayerTeam(*getPlayerID())->id;
double visited = 0.0;
if(CGObelisk::visited.count(t))
visited = static_cast<double>(CGObelisk::visited[t]);
if(gs->map->obelisksVisited.count(t))
visited = static_cast<double>(gs->map->obelisksVisited[t]);
*outKnownRatio = visited / CGObelisk::obeliskCount;
*outKnownRatio = visited / gs->map->obeliskCount;
}
return gs->map->grailPos;
}