From f961917b69d30e2562e3e98a62421fce56893311 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=8D=9A=7ENex?= <87421482+NexIsDumb@users.noreply.github.com> Date: Sun, 17 Mar 2024 00:03:25 +0100 Subject: [PATCH] fix frozen post sing characters --- source/funkin/game/Character.hx | 37 ++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/source/funkin/game/Character.hx b/source/funkin/game/Character.hx index 3733e7cc..b5c793b9 100644 --- a/source/funkin/game/Character.hx +++ b/source/funkin/game/Character.hx @@ -189,6 +189,10 @@ class Character extends FunkinSprite implements IBeatReceiver implements IOffset if (__stunnedTime > 5 / 60) stunned = false; } + + if (!__lockAnimThisFrame && (lastAnimContext == SING || lastAnimContext == MISS)) + tryDance(); + __lockAnimThisFrame = false; } @@ -199,24 +203,23 @@ class Character extends FunkinSprite implements IBeatReceiver implements IOffset */ public function dance() { - if (!debugMode) - { - var event = EventManager.get(DanceEvent).recycle(danced); - script.call("onDance", [event]); - if (event.cancelled) - return; + if(debugMode) return; - switch (curCharacter) - { - // hardcode custom dance animations here - default: - if (isDanceLeftDanceRight) - { - playAnim(((danced = !danced) ? 'danceLeft' : 'danceRight') + idleSuffix, DANCE); - } - else - playAnim('idle' + idleSuffix, DANCE); - } + var event = EventManager.get(DanceEvent).recycle(danced); + script.call("onDance", [event]); + if (event.cancelled) + return; + + switch (curCharacter) + { + // hardcode custom dance animations here + default: + if (isDanceLeftDanceRight) + { + playAnim(((danced = !danced) ? 'danceLeft' : 'danceRight') + idleSuffix, DANCE); + } + else + playAnim('idle' + idleSuffix, DANCE); } }