Prevent recruited ships moving after combat (engine 0.4.97)

This commit is contained in:
coyotte508 2026-10-16 16:21:49 +02:00
commit eceddf9c8b
5 changed files with 11 additions and 18 deletions

View file

@ -531,7 +531,11 @@ fn move_to_enemy_player_tile(
MoveResult::Move
}
fn apply_battle_movement_restriction(game: &mut Game, player_index: usize, unit_ids: &Vec<u32>) {
pub(crate) fn apply_battle_movement_restriction(
game: &mut Game,
player_index: usize,
unit_ids: &Vec<u32>,
) {
let mut military = false;
let can_ignore_battle_movement_restrictions_for_ships = game
.player(player_index)

View file

@ -218,6 +218,8 @@ pub(crate) fn on_recruit(game: &mut Game, player_index: usize, r: Recruit) {
set_unit_position(player_index, ship, city_position, game);
}
}
// Recruitment bypasses the movement path, but the fleet still fought.
combat::apply_battle_movement_restriction(game, player_index, &ships);
combat::initiate_combat(game, defender, port_position, player_index, ships, false);
}
}

View file

@ -361,21 +361,8 @@ fn test_recruit_combat() {
))),
)
.skip_json(),
TestAction::not_undoable(0, move_action(vec![12, 13], Position::from_offset("C4")))
TestAction::illegal(0, move_action(vec![12, 13], Position::from_offset("C4")))
.skip_json(),
TestAction::undoable(
0,
Action::Response(EventResponse::ResourceReward(ResourcePile::culture_tokens(
1,
))),
)
.skip_json(),
TestAction::undoable(
0,
Action::Response(EventResponse::SelectHandCards(vec![
HandCard::ObjectiveCard(38),
])),
),
],
);
}

View file

@ -1,12 +1,12 @@
{
"name": "@boardgamers/clash-web-client",
"version": "0.1.137",
"version": "0.1.138",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@boardgamers/clash-web-client",
"version": "0.1.137",
"version": "0.1.138",
"dependencies": {
"@boardgamers/protocol": "0.9.0",
"lucide-svelte": "^0.577.0",

View file

@ -1,6 +1,6 @@
{
"name": "@boardgamers/clash-web-client",
"version": "0.1.137",
"version": "0.1.138",
"private": true,
"type": "module",
"scripts": {