From 304878c7124dc023d8f0f768bfa54d4b6154a2d4 Mon Sep 17 00:00:00 2001 From: "rem..om" Date: Mon, 25 Feb 2013 09:23:36 +0000 Subject: [PATCH] Fixed issue where effect and audio tracks were looping even if they shouldn't git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10429 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- engine/src/core/com/jme3/animation/AudioTrack.java | 3 ++- engine/src/core/com/jme3/animation/EffectTrack.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/engine/src/core/com/jme3/animation/AudioTrack.java b/engine/src/core/com/jme3/animation/AudioTrack.java index 14d8d64f2..1440af160 100644 --- a/engine/src/core/com/jme3/animation/AudioTrack.java +++ b/engine/src/core/com/jme3/animation/AudioTrack.java @@ -68,6 +68,7 @@ public class AudioTrack implements ClonableTrack { private float length = 0; private boolean initialized = false; private boolean started = false; + private boolean played = false; //Animation listener to stop the sound when the animation ends or is changed private class OnEndListener implements AnimEventListener { @@ -121,7 +122,7 @@ public class AudioTrack implements ClonableTrack { */ public void setTime(float time, float weight, AnimControl control, AnimChannel channel, TempVars vars) { - if (time == length) { + if (time >= length) { return; } if (!initialized) { diff --git a/engine/src/core/com/jme3/animation/EffectTrack.java b/engine/src/core/com/jme3/animation/EffectTrack.java index fe79bf1bf..9d6b9b4d2 100644 --- a/engine/src/core/com/jme3/animation/EffectTrack.java +++ b/engine/src/core/com/jme3/animation/EffectTrack.java @@ -192,7 +192,7 @@ public class EffectTrack implements ClonableTrack { */ public void setTime(float time, float weight, AnimControl control, AnimChannel channel, TempVars vars) { - if (time == length) { + if (time >= length) { return; } //first time adding the Animation listener to stop the track at the end of the animation