1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-06 09:09:40 +02:00

Prefer to pass CGameState as reference instead of pointer

This commit is contained in:
Ivan Savenko
2025-04-19 14:14:12 +03:00
parent ce436bd63e
commit 4d57a8ed36
67 changed files with 465 additions and 466 deletions

View File

@@ -39,7 +39,7 @@ namespace AIPathfinding
CPlayerSpecificInfoCallback * cb,
VCAI * ai,
std::shared_ptr<AINodeStorage> nodeStorage)
:PathfinderConfig(nodeStorage, cb, makeRuleset(cb, ai, nodeStorage)), hero(nodeStorage->getHero())
:PathfinderConfig(nodeStorage, *cb, makeRuleset(cb, ai, nodeStorage)), hero(nodeStorage->getHero())
{
options.ignoreGuards = false;
options.useEmbarkAndDisembark = true;
@@ -51,7 +51,7 @@ namespace AIPathfinding
AIPathfinderConfig::~AIPathfinderConfig() = default;
CPathfinderHelper * AIPathfinderConfig::getOrCreatePathfinderHelper(const PathNodeInfo & source, CGameState * gs)
CPathfinderHelper * AIPathfinderConfig::getOrCreatePathfinderHelper(const PathNodeInfo & source, CGameState & gs)
{
if(!helper)
{

View File

@@ -30,6 +30,6 @@ namespace AIPathfinding
~AIPathfinderConfig();
CPathfinderHelper * getOrCreatePathfinderHelper(const PathNodeInfo & source, CGameState * gs) override;
CPathfinderHelper * getOrCreatePathfinderHelper(const PathNodeInfo & source, CGameState & gs) override;
};
}