1
0
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:
mateuszb
2009-09-16 10:59:56 +00:00
parent ba25f5c807
commit 80b5126cf5
3 changed files with 29 additions and 21 deletions

View File

@@ -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;
}