Skip to content

Commit

Permalink
Merge pull request #11352 from philcampeau/10069---1871-cannot-crossb…
Browse files Browse the repository at this point in the history
…uy-after-emergency-issue

[1871] Should not be able to crossbuy after issuing shares
  • Loading branch information
ollybh authored Dec 19, 2024
2 parents cec962f + 5e2346a commit 4d661ea
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/engine/game/g_1871/step/buy_train.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ def actions(entity)

def buyable_trains(entity)
super.reject do |train|
entity.id == 'PEIR' &&
train.from_depot? &&
@round.bought_trains.include?(entity)
(entity.id == 'PEIR' && train.from_depot? && @round.bought_trains.include?(entity)) ||
(@last_share_issued_price && !train.from_depot?)
end
end

Expand Down Expand Up @@ -69,6 +68,12 @@ def can_sell?(entity, bundle)

selling_minimum_shares?(bundle)
end

def process_sell_shares(action)
super

@last_share_issued_price = action.bundle.price_per_share if action.bundle.corporation == current_entity
end
end
end
end
Expand Down

0 comments on commit 4d661ea

Please sign in to comment.