File tree Expand file tree Collapse file tree 1 file changed +8
-11
lines changed
src/apps/chess/components Expand file tree Collapse file tree 1 file changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -517,6 +517,11 @@ def chess_character_display(
517
517
518
518
# Some data we'll need:
519
519
piece_player_side = player_side_from_piece_role (piece_role )
520
+ belongs_to_active_player = (
521
+ bool (piece_player_side == game_presenter .active_player_side )
522
+ if game_presenter
523
+ else False
524
+ )
520
525
is_my_turn = game_presenter .is_my_turn if game_presenter else False
521
526
is_playable = is_my_turn and (
522
527
(
@@ -558,20 +563,12 @@ def chess_character_display(
558
563
# Right, let's do this shall we?
559
564
if (
560
565
is_king
561
- and is_my_turn
562
- and game_presenter
563
- and game_presenter .solution_index is None
564
- and game_presenter .is_check
565
- ):
566
- is_potential_capture = True # let's highlight our king if it's in check
567
- elif (
568
- is_king
569
- and is_my_turn
570
566
and game_presenter
571
- and game_presenter . solution_index is not None
567
+ and belongs_to_active_player
572
568
and game_presenter .is_check
573
569
):
574
- is_potential_capture = True # let's highlight checks in "see solution" mode
570
+ # let's always highlight a king if it's in check:
571
+ is_potential_capture = True
575
572
576
573
horizontal_translation = (
577
574
("left-2" if (is_knight or is_king ) else "left-0" )
You can’t perform that action at this time.
0 commit comments