From 465b0ec5cb8d6eb2adcaf17934031e6ede6024b0 Mon Sep 17 00:00:00 2001 From: Yoshman29 <81191621+YoshiCrafter29@users.noreply.github.com> Date: Sun, 7 May 2023 13:03:40 +0200 Subject: [PATCH] oops --- source/funkin/backend/utils/CoolUtil.hx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/source/funkin/backend/utils/CoolUtil.hx b/source/funkin/backend/utils/CoolUtil.hx index ce531a79..a26be278 100644 --- a/source/funkin/backend/utils/CoolUtil.hx +++ b/source/funkin/backend/utils/CoolUtil.hx @@ -503,10 +503,12 @@ class CoolUtil */ public static inline function indexOfFromLast(array:Array, element:T):Int { var i = array.length - 1; - while(i >= 0) + while(i >= 0) { if (array[i] == element) - return i; - return -1; + break; + i--; + } + return i; } /**