1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-03-25 21:38:59 +02:00

Fix spellcast cancelation in battle

This commit is contained in:
Ivan Savenko 2023-05-30 19:16:50 +03:00
parent 0e36a3ab5a
commit 1cec6918a0
3 changed files with 4 additions and 8 deletions

@ -971,6 +971,9 @@ void BattleActionsController::activateStack()
void BattleActionsController::onHexRightClicked(BattleHex clickedHex)
{
if (spellcastingModeActive())
endCastingSpell();
auto selectedStack = owner.curInt->cb->battleGetStackByPos(clickedHex, true);
if (selectedStack != nullptr)

@ -85,7 +85,7 @@ BattleWindow::BattleWindow(BattleInterface & owner):
else
tacticPhaseEnded();
addUsedEvents(RCLICK | KEYBOARD);
addUsedEvents(KEYBOARD);
}
void BattleWindow::createQueue()
@ -203,12 +203,6 @@ void BattleWindow::keyPressed(EShortcut key)
InterfaceObjectConfigurable::keyPressed(key);
}
void BattleWindow::clickRight(tribool down, bool previousState)
{
if (!down)
owner.actionsController->endCastingSpell();
}
void BattleWindow::tacticPhaseStarted()
{
auto menuBattle = widget<CIntObject>("menuBattle");

@ -86,7 +86,6 @@ public:
void deactivate() override;
void keyPressed(EShortcut key) override;
bool captureThisKey(EShortcut key) override;
void clickRight(tribool down, bool previousState) override;
void show(Canvas & to) override;
void showAll(Canvas & to) override;