mirror of
https://github.com/vcmi/vcmi.git
synced 2025-03-21 21:17:49 +02:00
BattleActionsController: do not pass unused caster
This is unused, so, remove this parameter to prepare for teleport action
This commit is contained in:
parent
198df21ae3
commit
8397bd91fb
@ -569,10 +569,10 @@ bool BattleActionsController::actionIsLegal(PossiblePlayerBattleAction action, B
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
case PossiblePlayerBattleAction::ANY_LOCATION:
|
case PossiblePlayerBattleAction::ANY_LOCATION:
|
||||||
return isCastingPossibleHere(action.spell().toSpell(), owner.stacksController->getActiveStack(), targetStack, targetHex);
|
return isCastingPossibleHere(action.spell().toSpell(), targetStack, targetHex);
|
||||||
|
|
||||||
case PossiblePlayerBattleAction::AIMED_SPELL_CREATURE:
|
case PossiblePlayerBattleAction::AIMED_SPELL_CREATURE:
|
||||||
return !selectedStack && targetStack && isCastingPossibleHere(action.spell().toSpell(), owner.stacksController->getActiveStack(), targetStack, targetHex);
|
return !selectedStack && targetStack && isCastingPossibleHere(action.spell().toSpell(), targetStack, targetHex);
|
||||||
|
|
||||||
case PossiblePlayerBattleAction::RANDOM_GENIE_SPELL:
|
case PossiblePlayerBattleAction::RANDOM_GENIE_SPELL:
|
||||||
if(targetStack && targetStackOwned && targetStack != owner.stacksController->getActiveStack() && targetStack->alive()) //only positive spells for other allied creatures
|
if(targetStack && targetStackOwned && targetStack != owner.stacksController->getActiveStack() && targetStack->alive()) //only positive spells for other allied creatures
|
||||||
@ -593,8 +593,7 @@ bool BattleActionsController::actionIsLegal(PossiblePlayerBattleAction action, B
|
|||||||
|
|
||||||
case PossiblePlayerBattleAction::OBSTACLE:
|
case PossiblePlayerBattleAction::OBSTACLE:
|
||||||
case PossiblePlayerBattleAction::FREE_LOCATION:
|
case PossiblePlayerBattleAction::FREE_LOCATION:
|
||||||
return isCastingPossibleHere(action.spell().toSpell(), owner.stacksController->getActiveStack(), targetStack, targetHex);
|
return isCastingPossibleHere(action.spell().toSpell(), targetStack, targetHex);
|
||||||
return isCastingPossibleHere(action.spell().toSpell(), owner.stacksController->getActiveStack(), targetStack, targetHex);
|
|
||||||
|
|
||||||
case PossiblePlayerBattleAction::CATAPULT:
|
case PossiblePlayerBattleAction::CATAPULT:
|
||||||
return owner.siegeController && owner.siegeController->isAttackableByCatapult(targetHex);
|
return owner.siegeController && owner.siegeController->isAttackableByCatapult(targetHex);
|
||||||
@ -904,7 +903,7 @@ spells::Mode BattleActionsController::getCurrentCastMode() const
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BattleActionsController::isCastingPossibleHere(const CSpell * currentSpell, const CStack *casterStack, const CStack *targetStack, BattleHex targetHex)
|
bool BattleActionsController::isCastingPossibleHere(const CSpell * currentSpell, const CStack *targetStack, BattleHex targetHex)
|
||||||
{
|
{
|
||||||
assert(currentSpell);
|
assert(currentSpell);
|
||||||
if (!currentSpell)
|
if (!currentSpell)
|
||||||
|
@ -53,7 +53,7 @@ class BattleActionsController
|
|||||||
/// stack that has been selected as first target for multi-target spells (Teleport & Sacrifice)
|
/// stack that has been selected as first target for multi-target spells (Teleport & Sacrifice)
|
||||||
const CStack * selectedStack;
|
const CStack * selectedStack;
|
||||||
|
|
||||||
bool isCastingPossibleHere (const CSpell * spell, const CStack *sactive, const CStack *shere, BattleHex myNumber);
|
bool isCastingPossibleHere (const CSpell * spell, const CStack *shere, BattleHex myNumber);
|
||||||
bool canStackMoveHere (const CStack *sactive, BattleHex MyNumber) const; //TODO: move to BattleState / callback
|
bool canStackMoveHere (const CStack *sactive, BattleHex MyNumber) const; //TODO: move to BattleState / callback
|
||||||
std::vector<PossiblePlayerBattleAction> getPossibleActionsForStack (const CStack *stack) const; //called when stack gets its turn
|
std::vector<PossiblePlayerBattleAction> getPossibleActionsForStack (const CStack *stack) const; //called when stack gets its turn
|
||||||
void reorderPossibleActionsPriority(const CStack * stack, MouseHoveredHexContext context);
|
void reorderPossibleActionsPriority(const CStack * stack, MouseHoveredHexContext context);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user