mirror of
https://github.com/vcmi/vcmi.git
synced 2025-03-19 21:10:12 +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;
|
||||
|
||||
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:
|
||||
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:
|
||||
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::FREE_LOCATION:
|
||||
return isCastingPossibleHere(action.spell().toSpell(), owner.stacksController->getActiveStack(), targetStack, targetHex);
|
||||
return isCastingPossibleHere(action.spell().toSpell(), owner.stacksController->getActiveStack(), targetStack, targetHex);
|
||||
return isCastingPossibleHere(action.spell().toSpell(), targetStack, targetHex);
|
||||
|
||||
case PossiblePlayerBattleAction::CATAPULT:
|
||||
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);
|
||||
if (!currentSpell)
|
||||
|
@ -53,7 +53,7 @@ class BattleActionsController
|
||||
/// stack that has been selected as first target for multi-target spells (Teleport & Sacrifice)
|
||||
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
|
||||
std::vector<PossiblePlayerBattleAction> getPossibleActionsForStack (const CStack *stack) const; //called when stack gets its turn
|
||||
void reorderPossibleActionsPriority(const CStack * stack, MouseHoveredHexContext context);
|
||||
|
Loading…
x
Reference in New Issue
Block a user