Made condition more consistent📄

This commit is contained in:
Seoxi Ryouko
2025-03-02 07:56:35 -06:00
parent 159126e7ca
commit 67cc148bb8

View File

@ -358,9 +358,9 @@ pub fn discard(
Player::B => &mut game_state.hands[1],
};
gen_event!(game_state.events, Event::Discard(player.clone()));
if None == player_hand.cards.get(hand_index) {
return Err(format!("Discard index out of bounds: {}", hand_index));
}
if None == player_hand.cards.get(hand_index) {
return Err(format!("Discard index out of bounds: {}", hand_index));
}
let card = player_hand.cards.remove(hand_index);
if shadow {
game_state.shadow_realm.push(card);
@ -386,7 +386,7 @@ pub fn undiscard(
&mut game_state.discard_pile
};
if None == pile.get(pile_index) {
return Err(format!("Discard index out of bounds: {}", pile_index));
return Err(format!("Discard index out of bounds: {}", pile_index));
}
gen_event!(game_state.events, Event::Undiscard(player.clone()));
player_hand.cards.push(pile.remove(pile_index));
@ -422,7 +422,7 @@ pub fn unkill(
&mut game_state.discard_pile
};
if None == pile.get(pile_index) {
let pile_name = if shadow {
let pile_name = if shadow {
"shadow realm"
} else {
"discard pile"
@ -460,7 +460,7 @@ pub fn transfer_dead_card(
(&mut game_state.discard_pile, &mut game_state.shadow_realm)
};
if pile_index >= source.len() {
if None == source.get(pile_index) {
let direction = if shadow_to_discard {
"shadow realm -> discard pile"
} else {