Explorar o código

Nullkiller: fix merge conflicts

Andrii Danylchenko %!s(int64=4) %!d(string=hai) anos
pai
achega
79d06bbaa6

+ 2 - 2
AI/Nullkiller/AIGateway.cpp

@@ -487,7 +487,7 @@ void AIGateway::showWorldViewEx(const std::vector<ObjectPosInfo> & objectPositio
 	NET_EVENT_HANDLER;
 }
 
-void AIGateway::init(std::shared_ptr<CCallback> CB)
+void AIGateway::init(std::shared_ptr<Environment> env, std::shared_ptr<CCallback> CB)
 {
 	LOG_TRACE(logAi);
 	myCb = CB;
@@ -1005,7 +1005,7 @@ void AIGateway::recruitCreatures(const CGDwelling * d, const CArmedInstance * re
 		int count = d->creatures[i].first;
 		CreatureID creID = d->creatures[i].second.back();
 
-		vstd::amin(count, cb->getResourceAmount() / VLC->creh->creatures[creID]->cost);
+		vstd::amin(count, cb->getResourceAmount() / VLC->creh->objects[creID]->cost);
 		if(count > 0)
 			cb->recruitCreatures(d, recruiter, creID, count, i);
 	}

+ 1 - 1
AI/Nullkiller/AIGateway.h

@@ -109,7 +109,7 @@ public:
 
 	std::string getBattleAIName() const override;
 
-	void init(std::shared_ptr<CCallback> CB) override;
+	void init(std::shared_ptr<Environment> env, std::shared_ptr<CCallback> CB) override;
 	void yourTurn() override;
 
 	void heroGotLevel(const CGHeroInstance * hero, PrimarySkill::PrimarySkill pskill, std::vector<SecondarySkill> & skills, QueryID queryID) override; //pskill is gained primary skill, interface has to choose one of given skills and call callback with selection id

+ 1 - 1
AI/Nullkiller/AIUtility.cpp

@@ -323,7 +323,7 @@ creInfo infoFromDC(const dwellingContent & dc)
 	ci.creID = dc.second.size() ? dc.second.back() : CreatureID(-1); //should never be accessed
 	if (ci.creID != -1)
 	{
-		ci.cre = VLC->creh->creatures[ci.creID];
+		ci.cre = VLC->creh->objects[ci.creID].get();
 		ci.level = ci.cre->level; //this is cretaure tier, while tryRealize expects dwelling level. Ignore.
 	}
 	else

+ 2 - 2
AI/Nullkiller/Engine/PriorityEvaluator.cpp

@@ -171,10 +171,10 @@ uint64_t evaluateArtifactArmyValue(CArtifactInstance * art)
 		4 * art->valOfBonuses(Bonus::LAND_MOVEMENT)
 		+ 700 * art->valOfBonuses(Bonus::MORALE)
 		+ 700 * art->getAttack(false)
-		+ 700 * art->getDefence(false)
+		+ 700 * art->getDefense(false)
 		+ 700 * art->valOfBonuses(Bonus::PRIMARY_SKILL, PrimarySkill::KNOWLEDGE)
 		+ 700 * art->valOfBonuses(Bonus::PRIMARY_SKILL, PrimarySkill::SPELL_POWER)
-		+ 700 * art->getDefence(false)
+		+ 700 * art->getDefense(false)
 		+ 500 * art->valOfBonuses(Bonus::LUCK);
 
 	auto classValue = 0;

+ 1 - 1
AI/Nullkiller/Goals/AbstractGoal.cpp

@@ -57,7 +57,7 @@ std::string AbstractGoal::toString() const //TODO: virtualize
 		desc = "GATHER TROOPS";
 		break;
 	case GET_ART_TYPE:
-		desc = "GET ARTIFACT OF TYPE " + VLC->arth->artifacts[aid]->Name();
+		desc = "GET ARTIFACT OF TYPE " + VLC->arth->objects[aid]->getName();
 		break;
 	case DIG_AT_TILE:
 		desc = "DIG AT TILE " + tile.toString();

+ 1 - 1
AI/Nullkiller/Goals/AdventureSpellCast.cpp

@@ -32,7 +32,7 @@ void AdventureSpellCast::accept(AIGateway * ai)
 
 	logAi->trace("Decomposing adventure spell cast of %s for hero %s", spell->name, hero->name);
 
-	if(!spell->isAdventureSpell())
+	if(!spell->isAdventure())
 		throw cannotFulfillGoalException(spell->name + " is not an adventure spell.");
 
 	if(!hero->canCastThisSpell(spell))