Make IObjectInterface::cb non-static

This commit is contained in:
Ivan Savenko committed 2024-01-19 13:55:21 +02:00
1 parent c37ce05d06
commit a15366f5a5
89 files changed
+502 -445

No files matched your search

+1 -1
View File
@@ -128,7 +128,7 @@ class TemporaryArmy : public CArmedInstance
public:
void armyChanged() override {}
TemporaryArmy()
:CArmedInstance(true)
:CArmedInstance(nullptr, true)
{
}
};
@@ -165,7 +165,7 @@ void DangerHitMapAnalyzer::calculateTileOwners()
auto addTownHero = [&](const CGTownInstance * town)
{
auto townHero = new CGHeroInstance();
auto townHero = new CGHeroInstance(nullptr);
CRandomGenerator rng;
auto visitablePos = town->visitablePos();
+1 -1
View File
@@ -30,7 +30,7 @@ ui64 FuzzyHelper::estimateBankDanger(const CBank * bank)
ui64 totalStrength = 0;
ui8 totalChance = 0;
for(auto config : bankInfo->getPossibleGuards())
for(auto config : bankInfo->getPossibleGuards(bank->cb))
{
totalStrength += config.second.totalStrength * config.first;
totalChance += config.first;
+1 -1
View File
@@ -98,7 +98,7 @@ std::string CompleteQuest::questToString() const
return "inactive quest";
MetaString ms;
q.quest->getRolloverText(ms, false);
q.quest->getRolloverText(q.obj->cb, ms, false);
return ms.toString();
}
+1 -1
View File
@@ -31,7 +31,7 @@ public:
virtual bool needsLastStack() const override;
std::shared_ptr<SpecialAction> getActorAction() const;
HeroExchangeArmy(): CArmedInstance(true), requireBuyArmy(false) {}
HeroExchangeArmy(): CArmedInstance(nullptr, true), requireBuyArmy(false) {}
};
struct ExchangeResult
+1 -1
View File
@@ -72,7 +72,7 @@ ui64 FuzzyHelper::estimateBankDanger(const CBank * bank)
ui64 totalStrength = 0;
ui8 totalChance = 0;
for(auto config : bankInfo->getPossibleGuards())
for(auto config : bankInfo->getPossibleGuards(bank->cb))
{
totalStrength += config.second.totalStrength * config.first;
totalChance += config.first;
+1 -1
View File
@@ -103,7 +103,7 @@ std::string CompleteQuest::questToString() const
return "inactive quest";
MetaString ms;
q.quest->getRolloverText(ms, false);
q.quest->getRolloverText(q.obj->cb, ms, false);
return ms.toString();
}