EsotericSoftware/spine-runtimes — pull request #57 by moitias (2013-06-03 07:58:18+00:00)
Title: Fix a few Lua animation problems

Hey Nathan,
a couple of more quick fixes:
1) A probable typo in ColorTimeline:Apply, when alpha is < 1, you were using variable `color` to calculate the final color which isn't defined anywhere in the file (eg. Lua treats it as a global) when it most likely needs to be `slot`.
2) When animation duration is 0 (eg. when all timelines have a duration of 0), it used to cause an infinite loop in binarysearch. This is because Lua treats 0 as a truthy value and `value % 0` equals -INF, causing the binarysearch never to finish. This is now fixed by making sure the duration is greater than 0 before calculating `time = time % duration`, due to it being the least surprising place to put it in. However, it has some issues - blending to such an animation for example - but I thought the least surprising way was better than anything else that I could think of like forcing duration to be >0 when loading it. Let me know if you'd prefer another kind of a solution, I'd be happy to implement it your way.

Thanks again,
Matias