Skip to content

Commit 506b13c

Browse files
authored
dodging crashes
1 parent ce3e616 commit 506b13c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

source/states/PlayState.hx

+3-3
Original file line numberDiff line numberDiff line change
@@ -2919,7 +2919,7 @@ class PlayState extends MusicBeatState
29192919
var postfix:String = '';
29202920
if(note != null) postfix = note.animSuffix;
29212921

2922-
var animToPlay:String = singAnimations[Std.int(Math.abs(Math.min(singAnimations.length-1, direction)))] + 'miss' + postfix;
2922+
var animToPlay:String = singAnimations[direction % singAnimations.length-1] + 'miss' + postfix;
29232923
char.playAnim(animToPlay, true);
29242924

29252925
if(char != gf && lastCombo > 5 && gf != null && gf.hasAnimation('sad'))
@@ -2950,7 +2950,7 @@ class PlayState extends MusicBeatState
29502950
else if(!note.noAnimation)
29512951
{
29522952
var char:Character = dad;
2953-
var animToPlay:String = singAnimations[Std.int(Math.abs(Math.min(singAnimations.length-1, note.noteData)))] + note.animSuffix;
2953+
var animToPlay:String = singAnimations[note.noteData & singAnimations.length-1] + note.animSuffix;
29542954
if(note.gfNote) char = gf;
29552955

29562956
if(char != null)
@@ -3002,7 +3002,7 @@ class PlayState extends MusicBeatState
30023002
{
30033003
if(!note.noAnimation)
30043004
{
3005-
var animToPlay:String = singAnimations[Std.int(Math.abs(Math.min(singAnimations.length-1, note.noteData)))] + note.animSuffix;
3005+
var animToPlay:String = singAnimations[note.noteData % singAnimations.length-1] + note.animSuffix;
30063006

30073007
var char:Character = boyfriend;
30083008
var animCheck:String = 'hey';

0 commit comments

Comments
 (0)