Ok, without getting into the poisitioning etc, since I dont know that stuff:
- The muzzle flash code plays the corresoping ani file
- The next loop is not started until the previous one has finished. Even if the player is firing like crazy, there is only one animation playing at a time. Modders would get around this by simply making the ani length whatever the refire rate is. So therefore, even if you're firing at full speed, it looks right. This would be different for every weapon, so a seperate ani file would be used for each weapon.
__
Another idea is to have the animation stoo whever a new one is supposed to start (say I fire a shot before the intended end of the ani) and the new one start. So just cut the animation whenever a new shot is registered, and play it from the beggining.
Hope thats a little clearer, though I might have just confused you more.
edit: ok, I get it. I just assumed there is a play_ani fuction, didn't know there wasn't.