BGE: Fix T45945: Action bouncing.
authorPorteries Tristan <republicthunderbolt9@gmail.com>
Wed, 28 Oct 2015 13:30:52 +0000 (14:30 +0100)
committerPorteries Tristan <republicthunderbolt9@gmail.com>
Wed, 28 Oct 2015 14:13:12 +0000 (15:13 +0100)
commitf10db730bc4d8139e86ce078dd0fdd9fd07a8f35
tree7fcfc82905b9b084c59c3c79be9e063318f189a2
parente0c60985b64cf112cb782f6378552d5fc83f0f65
BGE: Fix T45945: Action bouncing.

Bug introduced in 583fa7d1e, KX_GameObject.setActionFrame can make BL_Action::m_starttime negative. But in BL_Action::Update m_starttime is set to the current time if it's negative.
To fix it we use a boolean BL_Action::m_initializedTime to know if we should initialize the time in BL_Action::Update, it's more stable than comparing times.

Tested with bug task T45945 and T32054, with an extra patch about to fix suspend resume scene issues with actions : D1569
source/gameengine/Ketsji/BL_Action.cpp
source/gameengine/Ketsji/BL_Action.h