Skip to content

Commit

Permalink
Merge pull request tobymao#9172 from bentziaxl/1880-9081
Browse files Browse the repository at this point in the history
[1880] fix 9081 - no end trigger if corp has no actions
  • Loading branch information
bentziaxl authored May 10, 2023
2 parents cec8695 + 3cf64bd commit dbb4ebe
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
8 changes: 4 additions & 4 deletions lib/engine/game/g_1880/round/operating.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ def after_process(action)
super
end

def after_end_of_turn(_action)
@game.end_game! if trigger_game_end?
def after_end_of_turn(operator)
@game.end_game! if trigger_game_end?(operator)
end

def trigger_game_end?
def trigger_game_end?(operator)
round_num == @game.final_operating_rounds &&
@current_operator == @game.train_marker
operator == @game.train_marker
end
end
end
Expand Down
9 changes: 6 additions & 3 deletions lib/engine/round/operating.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ def after_process(action)
return if entity.owner&.player? || entity.receivership?
end

after_end_of_turn(action)
after_end_of_turn(@current_operator)

next_entity! unless @game.finished
end

def after_end_of_turn(action); end
def after_end_of_turn(operator); end

def force_next_entity!
@steps.each(&:pass!)
Expand Down Expand Up @@ -84,7 +84,10 @@ def start_operating
@log << "#{@game.acting_for_entity(entity).name} operates #{entity.name}" unless finished?
@game.place_home_token(entity) if @home_token_timing == :operate
skip_steps
next_entity! if finished?
return unless finished?

after_end_of_turn(entity)
next_entity!
end

def recalculate_order
Expand Down

0 comments on commit dbb4ebe

Please sign in to comment.