Skip to content

Commit 9b9445c

Browse files
committed
fuck.
1 parent edc488b commit 9b9445c

File tree

2 files changed

+15
-20
lines changed

2 files changed

+15
-20
lines changed

source/games/uno/HandSwapSubstate.hx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,8 +427,6 @@ class HandSwapSubstate extends MusicBeatSubstate {
427427
new FlxTimer().start(0.6, function(_) {
428428
onComplete();
429429
});
430-
shouldBeClosed = true;
431-
close();
432430
meantToClose = true;
433431
}
434432
var meantToClose:Bool = false;

source/games/uno/UnoTestState.hx

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -394,27 +394,24 @@ class UnoTestState extends MusicBeatState {
394394
// Reset waiting flag first
395395
waitingForHandSwap = false;
396396

397-
// Perform the actual hand swap through the rules system
398-
if (performHandSwap != null)
397+
// Perform the actual hand swap through the rules system
399398
performHandSwap(selectedPlayer);
400399

401-
// Update UI after swap is complete
402-
if (selectedPlayer != null) {
403-
updateInstructionText('${currentPlayer.name} swapped hands with ${selectedPlayer.name}!', true);
404-
// Force display update to show new hands
405-
updateDisplay();
406-
} else {
407-
updateInstructionText("Hand swap cancelled", true);
400+
// Update UI after swap is complete
401+
if (selectedPlayer != null) {
402+
updateInstructionText('${currentPlayer.name} swapped hands with ${selectedPlayer.name}!', true);
403+
// Force display update to show new hands
404+
updateDisplay();
405+
} else {
406+
updateInstructionText("Hand swap cancelled", true);
407+
}
408+
} catch (e:Dynamic) {
409+
trace("Error in hand swap callback: " + e);
410+
// Ensure flags are reset even if an error occurs
411+
waitingForHandSwap = false;
412+
UnoRules.resetHandSwapFlag();
413+
updateInstructionText("Hand swap failed", true);
408414
}
409-
performHandSwap = null;
410-
unoGame.onSevenRuleHandSwap = null; // Clear the handler to prevent reuse
411-
return;
412-
}
413-
}, function(selectedPlayer:UnoPlayer) {
414-
// Reset waiting flag first
415-
waitingForHandSwap = false;
416-
417-
updateInstructionText("Hand swap cancelled", true);
418415
});
419416

420417
openSubState(handSwapSubstate);

0 commit comments

Comments
 (0)