1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Update docs, fix inconsistencies between config & code

This commit is contained in:
Ivan Savenko
2025-07-11 19:20:53 +03:00
parent b1aff17e82
commit 246010c13e
7 changed files with 211 additions and 18 deletions

View File

@@ -42,6 +42,7 @@
#include "../../lib/callback/CCallback.h"
#include "../../lib/spells/CSpellHandler.h"
#include "../../lib/spells/ISpellMechanics.h"
#include "../../lib/spells/adventure/AdventureSpellEffect.h"
#include "../../lib/spells/Problem.h"
#include "../../lib/spells/SpellSchoolHandler.h"
#include "../../lib/texts/CGeneralTextHandler.h"
@@ -752,12 +753,12 @@ void CSpellWindow::SpellArea::clickPressed(const Point & cursorPosition)
spells::detail::ProblemImpl problem;
if (mySpell->getAdventureMechanics().canBeCast(problem, GAME->interface()->cb.get(), owner->myHero))
{
if(mySpell->getTargetType() == spells::AimType::LOCATION)
const auto * rangeEffect = mySpell->getAdventureMechanics().getEffectAs<AdventureSpellRangedEffect>(owner->myHero);
if(rangeEffect != nullptr)
adventureInt->enterCastingMode(mySpell);
else if(mySpell->getTargetType() == spells::AimType::NO_TARGET)
owner->myInt->cb->castSpell(h, mySpell->id);
else
logGlobal->error("Invalid spell target type");
owner->myInt->cb->castSpell(h, mySpell->id);
}
else
{