Skip to content

Commit

Permalink
[1822CA] when acquiring a minor, clear graph if home token is not rep…
Browse files Browse the repository at this point in the history
…laced

Fixes #10151, where the bonus acquisition track step did not have a correct
graph for the acquiring major
  • Loading branch information
michaeljb committed Jan 18, 2024
1 parent 6ac5c09 commit 51c47b2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/engine/game/g_1822/step/minor_acquisition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -218,15 +218,15 @@ def process_choose(action)
after_acquire_bank_minor(action.entity)
else
acquire_entity_minor(action.entity, action.choice)
after_acquire_entity_minor(action.entity)
after_acquire_entity_minor(action.entity, action.choice)
end
@acquire_state = :select_minor
pass!
end
end

def after_acquire_bank_minor(entity); end
def after_acquire_entity_minor(entity); end
def after_acquire_entity_minor(entity, token_choice); end

def entity_connects?(entity, minor)
if (!minor.owner || minor.owner == @bank) && minor.id == @game.class::MINOR_14_ID
Expand Down
6 changes: 5 additions & 1 deletion lib/engine/game/g_1822_ca/step/minor_acquisition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@ def after_acquire_bank_minor(entity)
@round.acquiring_major = entity
end

def after_acquire_entity_minor(entity)
def after_acquire_entity_minor(entity, token_choice)
@round.acquiring_major = entity

# reset graph for the AcquisitionTrack step; when token is replaced
# the graph is already reset by the base 1822 step
@game.graph.clear_graph_for(entity) if token_choice == 'exchange'
end
end
end
Expand Down

0 comments on commit 51c47b2

Please sign in to comment.