mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-30 15:15:31 +00:00
Fix bug with loop key assignment
Animations with time of "loop start" == time of "loop stop" were not getting their loop times assigned correctly. This fixes incorrect playing of the jump animation, one aspect of Bug #2286.
This commit is contained in:
parent
17ada63fcb
commit
f6f82d433c
1 changed files with 12 additions and 15 deletions
|
@ -598,23 +598,20 @@ namespace MWRender
|
|||
state.setTime(state.mStartTime + ((state.mStopTime - state.mStartTime) * startpoint));
|
||||
|
||||
// mLoopStartTime and mLoopStopTime normally get assigned when encountering these keys while playing the animation
|
||||
// (see handleTextKey). But if startpoint is already past these keys, we need to assign them now.
|
||||
if(state.getTime() > state.mStartTime)
|
||||
// (see handleTextKey). But if startpoint is already past these keys, or start time is == stop time, we need to assign them now.
|
||||
const std::string loopstarttag = groupname+": loop start";
|
||||
const std::string loopstoptag = groupname+": loop stop";
|
||||
|
||||
NifOsg::TextKeyMap::const_reverse_iterator key(groupend);
|
||||
for (; key != startkey && key != keys.rend(); ++key)
|
||||
{
|
||||
const std::string loopstarttag = groupname+": loop start";
|
||||
const std::string loopstoptag = groupname+": loop stop";
|
||||
if (key->first > state.getTime())
|
||||
continue;
|
||||
|
||||
NifOsg::TextKeyMap::const_reverse_iterator key(groupend);
|
||||
for (; key != startkey && key != keys.rend(); ++key)
|
||||
{
|
||||
if (key->first > state.getTime())
|
||||
continue;
|
||||
|
||||
if (key->second == loopstarttag)
|
||||
state.mLoopStartTime = key->first;
|
||||
else if (key->second == loopstoptag)
|
||||
state.mLoopStopTime = key->first;
|
||||
}
|
||||
if (key->second == loopstarttag)
|
||||
state.mLoopStartTime = key->first;
|
||||
else if (key->second == loopstoptag)
|
||||
state.mLoopStopTime = key->first;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue