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 shares are not sellable #11499

Merged
merged 1 commit into from
Jan 30, 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
6 changes: 6 additions & 0 deletions lib/engine/game/g_1837/step/buy_sell_par_shares.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ def process_par(action)
super
@game.set_par(action.corporation, action.share_price, action.slot)
end

def can_sell?(entity, bundle)
return false if bundle.corporation.type == :minor

super
end
end
end
end
Expand Down
2 changes: 2 additions & 0 deletions lib/engine/step/buy_sell_par_shares.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ def actions(entity)
actions << 'sell_shares' if can_sell_any?(entity)

actions << 'pass' unless actions.empty?
puts entity.name
puts actions.inspect
Comment on lines +29 to +30
Copy link
Collaborator

Choose a reason for hiding this comment

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

@crericha You've commited some debugging code here.

actions
end

Expand Down