1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-29 00:41:38 +02:00

Code cleanup

This commit is contained in:
Ivan Savenko
2023-08-17 19:18:14 +03:00
parent c516b5a64e
commit 013417fb7e
27 changed files with 215 additions and 152 deletions

View File

@ -286,7 +286,7 @@ void BattleActionsController::castThisSpell(SpellID spellID)
{
heroSpellToCast = std::make_shared<BattleAction>();
heroSpellToCast->actionType = EActionType::HERO_SPELL;
heroSpellToCast->actionSubtype = spellID; //spell number
heroSpellToCast->spell = spellID;
heroSpellToCast->stackNumber = (owner.attackingHeroInstance->tempOwner == owner.curInt->playerID) ? -1 : -2;
heroSpellToCast->side = owner.defendingHeroInstance ? (owner.curInt->playerID == owner.defendingHeroInstance->tempOwner) : false;
@ -314,7 +314,7 @@ void BattleActionsController::castThisSpell(SpellID spellID)
const CSpell * BattleActionsController::getHeroSpellToCast( ) const
{
if (heroSpellToCast)
return SpellID(heroSpellToCast->actionSubtype).toSpell();
return heroSpellToCast->spell.toSpell();
return nullptr;
}