1
0
mirror of https://github.com/vcmi/vcmi.git synced 2026-05-22 09:55:17 +02:00

Allow toggling quick combat spells usage

This commit is contained in:
Dydzio
2023-08-19 17:23:55 +02:00
parent 5da1a6c412
commit 6bfbe80cc9
12 changed files with 101 additions and 7 deletions
+8 -1
View File
@@ -93,6 +93,12 @@ void CBattleAI::initBattleInterface(std::shared_ptr<Environment> ENV, std::share
movesSkippedByDefense = 0;
}
void CBattleAI::initBattleInterface(std::shared_ptr<Environment> ENV, std::shared_ptr<CBattleCallback> CB, AutocombatPreferences autocombatPreferences)
{
initBattleInterface(ENV, CB);
autobattlePreferences = autocombatPreferences;
}
BattleAction CBattleAI::useHealingTent(const CStack *stack)
{
auto healingTargets = cb->battleGetStacks(CBattleInfoEssentials::ONLY_MINE);
@@ -283,7 +289,8 @@ void CBattleAI::activeStack( const CStack * stack )
return;
}
attemptCastingSpell();
if(autobattlePreferences.enableSpellsUsage)
attemptCastingSpell();
logAi->trace("Spellcast attempt completed in %lld", timeElapsed(start));