mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
* fixed bug with lightning bolt
This commit is contained in:
parent
dce07fe1c9
commit
2d54b31b17
@ -146,6 +146,11 @@ bool CSpellEffectAnim::init()
|
||||
}
|
||||
}
|
||||
}
|
||||
else //there is nothing to play
|
||||
{
|
||||
endAnim();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else // Effects targeted at a specific creature/hex.
|
||||
{
|
||||
@ -161,6 +166,8 @@ bool CSpellEffectAnim::init()
|
||||
be.anim = CDefHandler::giveDef(graphics->battleACToDef[effect][0]);
|
||||
be.frame = 0;
|
||||
be.maxFrame = be.anim->ourImages.size();
|
||||
if(effect == 1)
|
||||
be.maxFrame = 3;
|
||||
|
||||
switch (effect)
|
||||
{
|
||||
@ -188,6 +195,11 @@ bool CSpellEffectAnim::init()
|
||||
|
||||
owner->battleEffects.push_back(be);
|
||||
}
|
||||
else //there is nothing to play
|
||||
{
|
||||
endAnim();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
//battleEffects
|
||||
return true;
|
||||
@ -197,18 +209,22 @@ void CSpellEffectAnim::nextFrame()
|
||||
{
|
||||
for(std::list<SBattleEffect>::iterator it = owner->battleEffects.begin(); it != owner->battleEffects.end(); ++it)
|
||||
{
|
||||
++(it->frame);
|
||||
if(it->effectID == ID)
|
||||
{
|
||||
++(it->frame);
|
||||
|
||||
if(it->frame == it->maxFrame)
|
||||
{
|
||||
endAnim();
|
||||
if(it->frame == it->maxFrame)
|
||||
{
|
||||
endAnim();
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
it->x += dx;
|
||||
it->y += dy;
|
||||
}
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
it->x += dx;
|
||||
it->y += dy;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,7 @@
|
||||
35 2 C01SPF.DEF C01SPF0.DEF
|
||||
36 2 C01SPW.DEF C01SPW0.DEF
|
||||
37 0
|
||||
38 0
|
||||
38 1 C11SPA1.DEF
|
||||
39 2 C03SPW.DEF C03SPW0.DEF
|
||||
40 2 C04SPW.DEF C04SPW0.DEF
|
||||
41 2 C05SPW.DEF C05SPW0.DEF
|
||||
|
Loading…
Reference in New Issue
Block a user