instance abandon finishes game
This commit is contained in:
parent
abdd612886
commit
ae5f51f9c8
@ -752,6 +752,7 @@ pub fn instance_abandon(tx: &mut Transaction, account: &Account, instance_id: Uu
|
|||||||
if let Some(game_id) = instance.current_game_id() {
|
if let Some(game_id) = instance.current_game_id() {
|
||||||
let mut game = game_get(tx, game_id)?;
|
let mut game = game_get(tx, game_id)?;
|
||||||
game.player_by_id(account.id)?.forfeit();
|
game.player_by_id(account.id)?.forfeit();
|
||||||
|
game = game.start(); // actually finishes it...
|
||||||
game_update(tx, &game)?;
|
game_update(tx, &game)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user