micahstairs / bga-innovation

MIT License
6 stars 2 forks source link

Battleship bismark returns an error #352

Closed ultimatefiend closed 2 years ago

ultimatefiend commented 2 years ago

Server syntax error: Notice: Undefined variable: selectable_colors in /var/tournoi/release/games/innovationdev/999999-9999/innovationdev.game.php on line 7464

Notice: Trying to access array offset on value of type null in /var/tournoi/release/games/innovationdev/999999-9999/innovationdev.game.php on line 7464 {"status":1,"data":{"valid":1,"data":{"tbyt":"0"}}}

ultimatefiend commented 2 years ago

What is selectable colors doing here:

    $args = array_merge($messages, $card_names, array(
        // Public info
        'card_name' => 'card_name',
        'special_type_of_choice' => $special_type_of_choice,
        'can_pass' => $can_pass,
        'can_stop' => $can_stop,
        'opponent_id' => $opponent_id,
        'splay_direction' => $splay_direction,
        'splay_direction_in_clear' => $splay_direction_in_clear,
        'color_pile' => $splay_direction === null && $location_from == 'pile' ? $selectable_colors[0] : null,

        // Private info
        '_private' => array(
            'active' => array( // "Active" player only
                "visible_selectable_cards" => self::getVisibleSelectedCards($player_id),
                "selectable_rectos" => self::getSelectableRectos($player_id), // Most of the time, the player choose among versos he can see this array is empty so this array is empty except for few dogma effects
                "must_show_score" => $must_show_score
            )
        ))
    );

THat's where the eror is occuring.

micahstairs commented 2 years ago

This error only happens when the pile being returned has more than 1 card in it.