mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-01 03:45:32 +00:00
Ignore text keys for zero-length animations (Fixes #1876)
This fixes an issue where the Riekling's attack animation would trigger *two* hits on each swing. It has the "min hit" and "hit" keys at the same time, so the MinHitToHit segment a zero-length animation. This caused problems as the "hit" text key will be encountered twice; once when playing the "max attack to min hit" segment and once when playing the "min hit to hit" segment.
This commit is contained in:
parent
07d827c907
commit
8b0cb239a9
1 changed files with 7 additions and 4 deletions
|
@ -873,10 +873,13 @@ void Animation::play(const std::string &groupname, int priority, int groups, boo
|
||||||
mStates[groupname] = state;
|
mStates[groupname] = state;
|
||||||
|
|
||||||
NifOgre::TextKeyMap::const_iterator textkey(textkeys.lower_bound(state.mTime));
|
NifOgre::TextKeyMap::const_iterator textkey(textkeys.lower_bound(state.mTime));
|
||||||
while(textkey != textkeys.end() && textkey->first <= state.mTime)
|
if (state.mPlaying)
|
||||||
{
|
{
|
||||||
handleTextKey(state, groupname, textkey, textkeys);
|
while(textkey != textkeys.end() && textkey->first <= state.mTime)
|
||||||
++textkey;
|
{
|
||||||
|
handleTextKey(state, groupname, textkey, textkeys);
|
||||||
|
++textkey;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(state.mTime >= state.mLoopStopTime && state.mLoopCount > 0)
|
if(state.mTime >= state.mLoopStopTime && state.mLoopCount > 0)
|
||||||
|
@ -887,7 +890,7 @@ void Animation::play(const std::string &groupname, int priority, int groups, boo
|
||||||
if(state.mTime >= state.mLoopStopTime)
|
if(state.mTime >= state.mLoopStopTime)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
textkey = textkeys.lower_bound(state.mTime);
|
NifOgre::TextKeyMap::const_iterator textkey(textkeys.lower_bound(state.mTime));
|
||||||
while(textkey != textkeys.end() && textkey->first <= state.mTime)
|
while(textkey != textkeys.end() && textkey->first <= state.mTime)
|
||||||
{
|
{
|
||||||
handleTextKey(state, groupname, textkey, textkeys);
|
handleTextKey(state, groupname, textkey, textkeys);
|
||||||
|
|
Loading…
Reference in a new issue