From f48eff5f673e17778090da0a8b8b74f002887742 Mon Sep 17 00:00:00 2001 From: loplkc Date: Fri, 11 Feb 2022 20:27:30 -0500 Subject: [PATCH] Minor changes to EffectMaker --- src/client/EffectMaker.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/client/EffectMaker.ts b/src/client/EffectMaker.ts index d3aa842..e6abd4a 100644 --- a/src/client/EffectMaker.ts +++ b/src/client/EffectMaker.ts @@ -57,12 +57,13 @@ class effectHandler implements effectMaker, effectRunner { } particleEffect() {} runEffects(timeSinceLastFrame: number) { - let effectsToRun = this.effectsToRun + let effectsToRun = this.effectsToRun; + print(tostring(effectsToRun.size()) + " effects to run."); for (const effect of effectsToRun) { // Update the effect time + let timeSinceLastKeypoint = effect[0] + timeSinceLastFrame; let nextKeypoint = effect[1][1]; let timeOfNextKeypoint = nextKeypoint[0]; - let timeSinceLastKeypoint = effect[0] + timeSinceLastFrame; while (timeSinceLastKeypoint >= timeOfNextKeypoint) { if (effect[1][2]) { timeSinceLastKeypoint -= timeOfNextKeypoint; @@ -70,13 +71,12 @@ class effectHandler implements effectMaker, effectRunner { nextKeypoint = effect[1][1]; timeOfNextKeypoint = nextKeypoint[0]; } else { - effect[2].Destroy() - effectsToRun.remove(0) - continue // Move on if this effect is done + effect[2].Destroy(); + effectsToRun.remove(0); + continue; // Move on if this effect is done } } effect[0] = timeSinceLastKeypoint; - // Get the rest of the variables const currentKeypoint = effect[1][0]; const easingStyle = currentKeypoint[5]; const meshPart = effect[2];