I wrote the function below [ in c++] to reload a gun which before had been in idling anim mode.The problem is it works great but ONLY ONCE. If I press R key after first time it does not respond;
Can anyone help?
frame = 0 at start. animlenght is 53.
void reload_gun()
{
if (gun.frame < gun.animlength)
{
gun.model->SetAnimationFrame(gun.frame, 1, gun.seq);
gun.frame = gun.frame + 1.0;
}
if (gun.frame >= gun.animlength)
{
idle = true;
done = true;
}