1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-30 21:45:33 +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:
scrawl 2015-07-16 19:55:05 +02:00
parent 17ada63fcb
commit f6f82d433c

View file

@ -598,23 +598,20 @@ namespace MWRender
state.setTime(state.mStartTime + ((state.mStopTime - state.mStartTime) * startpoint)); state.setTime(state.mStartTime + ((state.mStopTime - state.mStartTime) * startpoint));
// mLoopStartTime and mLoopStopTime normally get assigned when encountering these keys while playing the animation // 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. // (see handleTextKey). But if startpoint is already past these keys, or start time is == stop time, we need to assign them now.
if(state.getTime() > state.mStartTime) 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"; if (key->first > state.getTime())
const std::string loopstoptag = groupname+": loop stop"; continue;
NifOsg::TextKeyMap::const_reverse_iterator key(groupend); if (key->second == loopstarttag)
for (; key != startkey && key != keys.rend(); ++key) state.mLoopStartTime = key->first;
{ else if (key->second == loopstoptag)
if (key->first > state.getTime()) state.mLoopStopTime = key->first;
continue;
if (key->second == loopstarttag)
state.mLoopStartTime = key->first;
else if (key->second == loopstoptag)
state.mLoopStopTime = key->first;
}
} }
return true; return true;