diff --git a/source/funkin/game/PlayState.hx b/source/funkin/game/PlayState.hx index 6f203a741..ffac44571 100644 --- a/source/funkin/game/PlayState.hx +++ b/source/funkin/game/PlayState.hx @@ -1539,9 +1539,10 @@ class PlayState extends MusicBeatState * @param strumLine The strumline to get the camera position of. * @param pos The position to put the camera position in. If `null`, a new FlxPoint will be created. * @param ignoreInvisible Whenever invisible characters should be ignored. + * @param ignoreInactive Whether inactive characters should be ignored. **/ - public inline function getStrumlineCamPos(strumLine:Int, ?pos:FlxPoint = null, ?ignoreInvisible:Bool = true):CamPosData { - return getCharactersCamPos(strumLines.members[strumLine].characters, pos, ignoreInvisible); + public inline function getStrumlineCamPos(strumLine:Int, ?pos:FlxPoint = null, ?ignoreInvisible:Bool = true, ?ignoreInactive = false):CamPosData { + return getCharactersCamPos(strumLines.members[strumLine].characters, pos, ignoreInvisible, ignoreInactive); } /** @@ -1549,12 +1550,13 @@ class PlayState extends MusicBeatState * @param chars The characters to get the camera position of. * @param pos The position to put the camera position in. If `null`, a new FlxPoint will be created. * @param ignoreInvisible Whenever invisible characters should be ignored. + * @param ignoreInactive Whether inactive characters should be ignored. **/ - public dynamic function getCharactersCamPos(chars:Array, ?pos:FlxPoint = null, ?ignoreInvisible:Bool = true):CamPosData { + public dynamic function getCharactersCamPos(chars:Array, ?pos:FlxPoint = null, ?ignoreInvisible:Bool = true, ?ignoreInactive = false):CamPosData { if (pos == null) pos = FlxPoint.get(); - var amount = 0; + var amount:Int = 0; for(c in chars) { - if (c == null || (ignoreInvisible && !c.visible)) continue; + if (c == null || (ignoreInvisible && (c.alpha <= 0 || !c.visible || !c.exists)) || (ignoreInactive && !c.active)) continue; var cpos = c.getCameraPosition(); pos.x += cpos.x; pos.y += cpos.y;