diff --git a/flixel/addons/effects/FlxTrail.hx b/flixel/addons/effects/FlxTrail.hx index 6f5112b1..e7caef35 100644 --- a/flixel/addons/effects/FlxTrail.hx +++ b/flixel/addons/effects/FlxTrail.hx @@ -244,7 +244,8 @@ class FlxTrail extends #if (flixel < "5.7.0") FlxSpriteGroup #else FlxSpriteCont function cacheValue(array:Array, value:T) { array.unshift(value); - FlxArrayUtil.setLength(array, _trailLength); + if (array.length > _trailLength) + array.resize(_trailLength); } public function resetTrail():Void diff --git a/flixel/addons/nape/FlxNapeTilemap.hx b/flixel/addons/nape/FlxNapeTilemap.hx index 49122efd..613841f9 100644 --- a/flixel/addons/nape/FlxNapeTilemap.hx +++ b/flixel/addons/nape/FlxNapeTilemap.hx @@ -42,7 +42,7 @@ class FlxNapeTilemap extends FlxTilemap { super.loadMapFromCSV(MapData, TileGraphic, TileWidth, TileHeight, AutoTile, StartingIndex, DrawIndex, CollideIndex); _binaryData = new Array(); - FlxArrayUtil.setLength(_binaryData, _data.length); + _binaryData.resize(_data.length); return this; } @@ -51,7 +51,7 @@ class FlxNapeTilemap extends FlxTilemap { super.loadMapFromArray(MapData, WidthInTiles, HeightInTiles, TileGraphic, TileWidth, TileHeight, AutoTile, StartingIndex, DrawIndex, CollideIndex); _binaryData = new Array(); - FlxArrayUtil.setLength(_binaryData, _data.length); + _binaryData.resize(_data.length); return this; } @@ -60,7 +60,7 @@ class FlxNapeTilemap extends FlxTilemap { super.loadMapFrom2DArray(MapData, TileGraphic, TileWidth, TileHeight, AutoTile, StartingIndex, DrawIndex, CollideIndex); _binaryData = new Array(); - FlxArrayUtil.setLength(_binaryData, _data.length); + _binaryData.resize(_data.length); return this; }