diff --git a/source/FlxFunkGame.hx b/source/FlxFunkGame.hx index a203962c..f9bc84b6 100644 --- a/source/FlxFunkGame.hx +++ b/source/FlxFunkGame.hx @@ -43,8 +43,10 @@ class FlxFunkGame extends FlxGame { transition.update(FlxG.elapsed); console.update(FlxG.elapsed); - for (i in 0...updateObjects.length) { - updateObjects[i].update(FlxG.elapsed); + if (updateObjects.length > 0) { + for (i in 0...updateObjects.length) { + updateObjects[i].update(FlxG.elapsed); + } } } } diff --git a/source/funkin/objects/NotesGroup.hx b/source/funkin/objects/NotesGroup.hx index 38c606be..d57b7469 100644 --- a/source/funkin/objects/NotesGroup.hx +++ b/source/funkin/objects/NotesGroup.hx @@ -487,7 +487,6 @@ class NotesGroup extends FlxGroup for (badNote in removeList) badNote.removeNote(); final onGhost = isPlayState ? PlayState.instance.ghostTapEnabled : true; - possibleNotes.sort(CoolUtil.sortByStrumTime); if (possibleNotes.length > 0) { if (!onGhost) { for (i in 0...controlArray.length) { diff --git a/source/funkin/util/modding/FunkScript.hx b/source/funkin/util/modding/FunkScript.hx index 7cf927e0..2b66fc4e 100644 --- a/source/funkin/util/modding/FunkScript.hx +++ b/source/funkin/util/modding/FunkScript.hx @@ -157,16 +157,7 @@ class FunkScript extends hscript.Script implements IFlxDestroyable { }); set('getBlendMode', function(blendType:String):openfl.display.BlendMode { - switch(blendType.toLowerCase().trim()) { - case 'add': return ADD; case 'alpha': return ALPHA; - case 'darken': return DARKEN; case 'difference': return DIFFERENCE; - case 'erase': return ERASE; case 'hardlight': return HARDLIGHT; - case 'invert': return INVERT; case 'layer': return LAYER; - case 'lighten': return LIGHTEN; case 'multiply': return MULTIPLY; - case 'overlay': return OVERLAY; case 'screen': return SCREEN; - case 'shader': return SHADER; case 'subtract': return SUBTRACT; - default: return NORMAL; - } + return ScriptUtil.stringToBlend(blendType); }); set('parseJson', function (value:String):Dynamic { diff --git a/source/funkin/util/modding/ScriptUtil.hx b/source/funkin/util/modding/ScriptUtil.hx index 6dfc42d3..2f1d4f31 100644 --- a/source/funkin/util/modding/ScriptUtil.hx +++ b/source/funkin/util/modding/ScriptUtil.hx @@ -91,4 +91,17 @@ class ScriptUtil { skipTransClose: skipTransClose ?? skipTransOpen } } + + public inline static function stringToBlend(value:String):openfl.display.BlendMode { + return switch(value.toLowerCase().trim()) { + case 'add': ADD; case 'alpha': ALPHA; + case 'darken': DARKEN; case 'difference': DIFFERENCE; + case 'erase': ERASE; case 'hardlight': HARDLIGHT; + case 'invert': INVERT; case 'layer': LAYER; + case 'lighten': LIGHTEN; case 'multiply': MULTIPLY; + case 'overlay': OVERLAY; case 'screen': SCREEN; + case 'shader': SHADER; case 'subtract': SUBTRACT; + default: NORMAL; + } + } } \ No newline at end of file