Skip to content

Commit

Permalink
crash preventions
Browse files Browse the repository at this point in the history
  • Loading branch information
ShadowMario committed Aug 16, 2024
1 parent 6f25962 commit fb1096f
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions source/states/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,10 @@ class PlayState extends MusicBeatState
public var camFollow:FlxObject;
private static var prevCamFollow:FlxObject;

public var strumLineNotes:FlxTypedGroup<StrumNote>;
public var opponentStrums:FlxTypedGroup<StrumNote>;
public var playerStrums:FlxTypedGroup<StrumNote>;
public var grpNoteSplashes:FlxTypedGroup<NoteSplash>;
public var strumLineNotes:FlxTypedGroup<StrumNote> = new FlxTypedGroup<StrumNote>();
public var opponentStrums:FlxTypedGroup<StrumNote> = new FlxTypedGroup<StrumNote>();
public var playerStrums:FlxTypedGroup<StrumNote> = new FlxTypedGroup<StrumNote>();
public var grpNoteSplashes:FlxTypedGroup<NoteSplash> = new FlxTypedGroup<NoteSplash>();

public var camZooming:Bool = false;
public var camZoomingMult:Float = 1;
Expand Down Expand Up @@ -289,7 +289,6 @@ class PlayState extends MusicBeatState

FlxG.cameras.add(camHUD, false);
FlxG.cameras.add(camOther, false);
grpNoteSplashes = new FlxTypedGroup<NoteSplash>();

persistentUpdate = true;
persistentDraw = true;
Expand Down Expand Up @@ -471,7 +470,6 @@ class PlayState extends MusicBeatState
uiGroup.add(timeBar);
uiGroup.add(timeTxt);

strumLineNotes = new FlxTypedGroup<StrumNote>();
noteGroup.add(strumLineNotes);

if(ClientPrefs.data.timeBarType == 'Song Name')
Expand All @@ -480,9 +478,6 @@ class PlayState extends MusicBeatState
timeTxt.y += 3;
}

opponentStrums = new FlxTypedGroup<StrumNote>();
playerStrums = new FlxTypedGroup<StrumNote>();

generateSong();

noteGroup.add(grpNoteSplashes);
Expand Down Expand Up @@ -2276,13 +2271,15 @@ class PlayState extends MusicBeatState
{
if(isDad)
{
if(dad == null) return;
camFollow.setPosition(dad.getMidpoint().x + 150, dad.getMidpoint().y - 100);
camFollow.x += dad.cameraPosition[0] + opponentCameraOffset[0];
camFollow.y += dad.cameraPosition[1] + opponentCameraOffset[1];
tweenCamIn();
}
else
{
if(boyfriend == null) return;
camFollow.setPosition(boyfriend.getMidpoint().x - 100, boyfriend.getMidpoint().y - 100);
camFollow.x -= boyfriend.cameraPosition[0] - boyfriendCameraOffset[0];
camFollow.y += boyfriend.cameraPosition[1] + boyfriendCameraOffset[1];
Expand Down

0 comments on commit fb1096f

Please sign in to comment.