Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1837] Minor bug fixes #11506

Merged
merged 3 commits into from
Feb 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/engine/game/g_1837/game.rb
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ def initial_auction_companies

def setup
non_purchasable = @companies.flat_map do |c|
[abilities(c, :acquire_company, time: 'any')&.company, c.meta['hidden'] ? c.id : nil]
[abilities(c, :acquire_company, time: 'any')&.company, c.meta[:hidden] ? c.id : nil]
end.compact
@companies.each { |company| company.owner = @bank unless non_purchasable.include?(company.id) }
setup_mines
Expand Down Expand Up @@ -597,6 +597,7 @@ def new_auction_round

def stock_round
Engine::Round::Stock.new(self, [
G1837::Step::HomeToken,
G1837::Step::DiscardTrain,
G1837::Step::BuySellParShares,
])
Expand Down Expand Up @@ -666,7 +667,7 @@ def float_minor!(minor)
cash = minor_initial_cash(minor)
@bank.spend(cash, minor)
@log << "#{minor.name} receives #{format_currency(cash)}"
if [email protected]_a?(Engine::Round::Auction) && minor.name == 'SD5'
if [email protected]_a?(Engine::Round::Auction) && minor.id == 'SD5'
coordinates = minor.coordinates
minor.coordinates = coordinates.shift
remove_reservations!(minor, coordinates)
Expand Down
2 changes: 1 addition & 1 deletion lib/engine/share_pool.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def buy_shares(entity, shares, exchange: nil, exchange_price: nil, swap: nil,
price = bundle.price
par_price = corporation.par_price&.price

if ipoed != corporation.ipoed && !silent
if ipoed != corporation.ipoed && par_price && !silent
@log << "#{entity.name} #{@game.ipo_verb(corporation)} #{corporation.name} at "\
"#{@game.format_currency(par_price)}"
end
Expand Down