1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-24 08:32:34 +02:00

probably fixed problems with battles

This commit is contained in:
mateuszb 2008-10-04 09:27:57 +00:00
parent b08b29d0d8
commit e94e6ac78a
2 changed files with 4 additions and 2 deletions

View File

@ -370,7 +370,7 @@ void CBattleInterface::show(SDL_Surface * to)
{
for(int v=0; v<stackDeadByHex[b].size(); ++v)
{
creAnims[stackDeadByHex[b][v]]->nextFrame(to, creAnims[stackDeadByHex[b][v]]->pos.x, creAnims[stackDeadByHex[b][v]]->pos.y, creDir[stackDeadByHex[b][v]], (animCount%(4/animSpeed)==0 || creAnims[stackDeadByHex[b][v]]->getType()!=2) && stacks[stackDeadByHex[b][v]].alive(), stackDeadByHex[b][v]==activeStack); //increment always when moving, never if stack died
creAnims[stackDeadByHex[b][v]]->nextFrame(to, creAnims[stackDeadByHex[b][v]]->pos.x, creAnims[stackDeadByHex[b][v]]->pos.y, creDir[stackDeadByHex[b][v]], (animCount%(4/animSpeed)==0) && creAnims[stackDeadByHex[b][v]]->getType()!=5, stackDeadByHex[b][v]==activeStack); //increment always when moving, never if stack died
//printing amount
if(stacks[stackDeadByHex[b][v]].amount > 0) //don't print if stack is not alive
{
@ -1011,6 +1011,8 @@ void CBattleInterface::stackAttacking(int ID, int dest)
case 5:
attackingInfo->maxframe = creAnims[ID]->framesInGroup(12);
break;
default:
tlog1<<"Critical Error! Wrong dest in stackAttacking!"<<std::endl;
}
}

View File

@ -2082,7 +2082,7 @@ void CPlayerInterface::battleAttack(BattleAttack *ba)
if(ba->shot())
dynamic_cast<CBattleInterface*>(curint)->stackIsShooting(ba->stackAttacking,cb->battleGetPos(ba->bsa.stackAttacked));
else
dynamic_cast<CBattleInterface*>(curint)->stackAttacking( ba->stackAttacking, curAction->additionalInfo );
dynamic_cast<CBattleInterface*>(curint)->stackAttacking( ba->stackAttacking, ba->counter() ? curAction->destinationTile : curAction->additionalInfo );
if(ba->killed())
dynamic_cast<CBattleInterface*>(curint)->stackKilled(ba->bsa.stackAttacked, ba->bsa.damageAmount, ba->bsa.killedAmount, ba->stackAttacking, ba->shot());
else