diff --git a/source/funkin/backend/system/updating/AsyncUpdater.hx b/source/funkin/backend/system/updating/AsyncUpdater.hx index af7cfff5..e742e92d 100644 --- a/source/funkin/backend/system/updating/AsyncUpdater.hx +++ b/source/funkin/backend/system/updating/AsyncUpdater.hx @@ -101,7 +101,7 @@ class AsyncUpdater { progress.files = files.length; progress.step = DOWNLOADING_ASSETS; trace('starting assets download'); - doFile([for(e in files) e], [for(e in fileNames) e], function() { + doFile(files.copy(), fileNames.copy(), function() { progress.curFile = -1; progress.curFileName = null; progress.files = 1; diff --git a/source/funkin/editors/charter/Charter.hx b/source/funkin/editors/charter/Charter.hx index 2ff39aa0..99f6f690 100644 --- a/source/funkin/editors/charter/Charter.hx +++ b/source/funkin/editors/charter/Charter.hx @@ -1657,7 +1657,7 @@ class Charter extends UIState { changeNoteSustain(-1); function _note_selectall(_) { - selection = [for (note in notesGroup.members) note]; + selection = cast notesGroup.members.copy(); } function _note_selectmeasure(_) { diff --git a/source/funkin/editors/charter/CharterBackdropGroup.hx b/source/funkin/editors/charter/CharterBackdropGroup.hx index e9240ad1..21eeb90f 100644 --- a/source/funkin/editors/charter/CharterBackdropGroup.hx +++ b/source/funkin/editors/charter/CharterBackdropGroup.hx @@ -253,7 +253,7 @@ class CharterBackdropDummy extends UISprite { public override function draw() { @:privateAccess - __lastDrawCameras = [for(c in cameras) c]; + __lastDrawCameras = cameras.copy(); } } diff --git a/source/funkin/editors/ui/UISprite.hx b/source/funkin/editors/ui/UISprite.hx index 5a41cec3..1246e6de 100644 --- a/source/funkin/editors/ui/UISprite.hx +++ b/source/funkin/editors/ui/UISprite.hx @@ -69,7 +69,7 @@ class UISprite extends FlxSprite { public function drawSuper() { super.draw(); - __lastDrawCameras = [for(c in cameras) c]; + __lastDrawCameras = cameras.copy(); } public function drawMembers() { diff --git a/source/funkin/game/Note.hx b/source/funkin/game/Note.hx index b8baf48e..9b06fc81 100644 --- a/source/funkin/game/Note.hx +++ b/source/funkin/game/Note.hx @@ -98,6 +98,9 @@ class Note extends FlxSprite return __customNoteTypeExists[path]; return __customNoteTypeExists[path] = Assets.exists(path); } + + static var DEFAULT_FIELDS:Array = ["time", "id", "type", "sLen"]; + public function new(strumLine:StrumLine, noteData:ChartNote, sustain:Bool = false, sustainLength:Float = 0, sustainOffset:Float = 0, ?prev:Note) { super(); @@ -115,7 +118,7 @@ class Note extends FlxSprite this.sustainLength = sustainLength; this.strumLine = strumLine; for(field in Reflect.fields(noteData)) { - if(!["time", "id", "type", "sLen"].contains(field)) { + if(!DEFAULT_FIELDS.contains(field)) { this.extra.set(field, Reflect.field(noteData, field)); } } @@ -290,7 +293,7 @@ class Note extends FlxSprite setClipRect(swagRect); } - public function setClipRect(rect:FlxRect) { + public inline function setClipRect(rect:FlxRect) { this.clipRect = rect; } diff --git a/source/funkin/game/Strum.hx b/source/funkin/game/Strum.hx index e2b6ccd0..cbce2da4 100644 --- a/source/funkin/game/Strum.hx +++ b/source/funkin/game/Strum.hx @@ -74,7 +74,7 @@ class Strum extends FlxSprite { } public override function draw() { - lastDrawCameras = [for(c in cameras) c]; + lastDrawCameras = cameras.copy(); super.draw(); }