Skip to content

Commit 33d0205

Browse files
committed
Update APItem.hx
now it actually works everywhere
1 parent 9af36f8 commit 33d0205

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

source/archipelago/APItem.hx

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -261,12 +261,14 @@ class APItem {
261261
case "Pong Challenge":
262262
return new APTrap(name, ConditionHelper.Everywhere(), function() {
263263
popup('Ok but can you beat the Pong Master?', "APItem: Pong Challenge", true);
264-
APPlayState.instance.paused = true;
265-
APPlayState.instance.canResync = false;
266-
FlxG.camera.followLerp = 0;
267-
LoadingState.noteCache = [];
268-
states.PlayState.curChart = [];
269-
MusicBeatState.allowNuke = true;
264+
if (MusicBeatState.getState() == APPlayState.instance) {
265+
APPlayState.instance.paused = true;
266+
APPlayState.instance.canResync = false;
267+
FlxG.camera.followLerp = 0;
268+
LoadingState.noteCache = [];
269+
states.PlayState.curChart = [];
270+
MusicBeatState.allowNuke = true;
271+
}
270272
FlxG.switchState(new archipelago.traps.games.APPongTrapState(MusicBeatState.getState()));
271273
}, true, false).funcAndReturn(function(t:APItem) {
272274
// Set it as a trap.
@@ -322,13 +324,15 @@ class APItem {
322324
case "UNO Challenge":
323325
return new APTrap(name, ConditionHelper.Everywhere(), function() {
324326
popup('Win the round to survive!', "APItem: UNO Challenge", true);
325-
APPlayState.instance.paused = true;
326-
APPlayState.instance.canResync = false;
327-
FlxG.camera.followLerp = 0;
328-
LoadingState.noteCache = [];
329-
states.PlayState.curChart = [];
330-
MusicBeatState.allowNuke = true;
331-
FlxG.switchState(new archipelago.traps.games.APPongTrapState(MusicBeatState.getState()));
327+
if (MusicBeatState.getState() == APPlayState.instance) {
328+
APPlayState.instance.paused = true;
329+
APPlayState.instance.canResync = false;
330+
FlxG.camera.followLerp = 0;
331+
LoadingState.noteCache = [];
332+
states.PlayState.curChart = [];
333+
MusicBeatState.allowNuke = true;
334+
}
335+
FlxG.switchState(new archipelago.traps.games.APUnoTrapState(MusicBeatState.getState()));
332336
}, true, false).funcAndReturn(function(t:APItem) {
333337
// Set it as a trap.
334338
t.isTrap = true;

0 commit comments

Comments
 (0)