Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions lib/engine/corporation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ def initialize(sym:, name:, **opts)
@reservation_color = opts[:reservation_color]
@price_percent = opts[:price_percent] || @second_share&.percent || (@presidents_share.percent / 2)
@price_multiplier = (@second_share&.percent || (@presidents_share.percent / 2)) / @price_percent
@forced_share_percent = opts[:@forced_share_percent]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking issue: Typo in option key

The key should be :forced_share_percent not :@forced_share_percent:

@forced_share_percent = opts[:forced_share_percent]

The @ prefix in the symbol key is incorrect. Compare with other options in the same method:

  • opts[:price_percent]
  • opts[:reservation_color]
  • opts[:treasury_as_holding]

All use symbols without the @ prefix. This typo will cause the option to never be read from entities.

@treasury_as_holding = opts[:treasury_as_holding] || false
@corporation_can_ipo = opts[:corporation_can_ipo]

Expand Down
2 changes: 2 additions & 0 deletions lib/engine/game/g_1835/entities.rb
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ module Entities
max_ownership_percent: 100,
shares: [20, 20, 20, 10, 10, 10, 10],
price_percent: 20,
forced_share_percent: 10,
fraction_shares: false,
coordinates: 'C13',
color: :violet,
Expand All @@ -314,6 +315,7 @@ module Entities
max_ownership_percent: 100,
shares: [20, 20, 20, 10, 10, 10, 10],
price_percent: 20,
forced_share_percent: 10,
fraction_shares: false,
coordinates: 'D6',
color: '#6e6966',
Expand Down
2 changes: 0 additions & 2 deletions lib/engine/game/g_1835/game.rb
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,6 @@ def setup

corporation_by_id('BY').ipoed = true
corporation_by_id('SX').ipoed = true
corporation_by_id('MS').forced_share_percent = 10
corporation_by_id('OL').forced_share_percent = 10

@corporation_blocks = CORPORATION_BLOCKS.map { |block| block.map { |c| corporation_by_id(c) } }
end
Expand Down
Loading