mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
* support for RETURN_AFTER_STRIKE feature
This commit is contained in:
@@ -2444,6 +2444,7 @@ bool CGameHandler::makeBattleAction( BattleAction &ba )
|
||||
case 6: //walk or attack
|
||||
{
|
||||
sendAndApply(&StartAction(ba)); //start movement and attack
|
||||
int startingPos = gs->curB->getStack(ba.stackNumber)->position;
|
||||
int distance = moveStack(ba.stackNumber, ba.destinationTile);
|
||||
CStack *curStack = gs->curB->getStack(ba.stackNumber),
|
||||
*stackAtEnd = gs->curB->getStackT(ba.additionalInfo);
|
||||
@@ -2526,6 +2527,12 @@ bool CGameHandler::makeBattleAction( BattleAction &ba )
|
||||
prepareAttack(bat, curStack, stackAtEnd, 0);
|
||||
sendAndApply(&bat);
|
||||
}
|
||||
|
||||
//return
|
||||
if(curStack->hasFeatureOfType(StackFeature::RETURN_AFTER_STRIKE))
|
||||
{
|
||||
moveStack(ba.stackNumber, startingPos);
|
||||
}
|
||||
sendAndApply(&EndAction());
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user