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

[Steam Over Holland] cannot sell shares during forced train buy action #11581

Open
coen4git opened this issue Feb 26, 2025 · 3 comments · May be fixed by #11607
Open

[Steam Over Holland] cannot sell shares during forced train buy action #11581

coen4git opened this issue Feb 26, 2025 · 3 comments · May be fixed by #11607
Assignees
Labels
bug Prevents game from being played correctly Steam Over Holland

Comments

@coen4git
Copy link

In [Steam Over Holland]player got an error when attempting to sell personal share to get funds for buying a train for the NRS

Gamie Id: 198632

What's your Game ID?

How to Reproduce the Bug?

Which Browser / Platform?

@ollybh ollybh added bug Prevents game from being played correctly Steam Over Holland and removed needs triage labels Feb 26, 2025
@ollybh
Copy link
Collaborator

ollybh commented Feb 26, 2025

The error is "Blocking step Buy Trains cannot process action 384".

@philcampeau What seems to be happening here is that GSteamOverHolland::Step::BuyTrain.actions isn't returning sell_shares as a valid action, so Round::Base.process_action doesn't know what to do when the button to sell shares is clicked.

@philcampeau
Copy link
Collaborator

philcampeau commented Mar 6, 2025

@ollybh I've figured out what's happening now, but I'm still trying to figure out why it's happening. It looks like when players sell shares, the game is using the process_sell_shares method from GSteamOverHolland::Step::IssueShares instead of the one I would expect it to import from Engine::Step::BuyTrains.

I noticed that I had the method for process_sell_shares from my issue_shares step also in my buy_trains.rb file. But even removing that makes no difference. Nor does adding the process_sell_shares code directly from Engine::Step::BuyTrains into my buy_trains.rb file. What's more, I inserted a different print command into the process_sell_shares method in both of those steps in my game, and only the one in the issue_shares step showed up in the console.

@ollybh
Copy link
Collaborator

ollybh commented Mar 6, 2025

@philcampeau That doesn't sound the same as this issue. It might be a problem with the Steam over Holland code, but that's not causing this error. The "blocking step xxx cannot process action" comes from Engine::Round::Base.process_action.

step = @steps.find do |s|
next unless s.active?
process = s.actions(action.entity).include?(type)
blocking = s.blocking?
raise GameError, "Blocking step #{s.description} cannot process action #{action.id}" if blocking && !process
blocking || process
end

This method is invoked to (as you might guess from the name) process an action. It executes each step's actions method and looks for an action of the correct type, in this case Action::SellShares. No step is being found, giving that action.

So for some reason Step::BuyTrain isn't including sell_shares as an action. I guess it must do at some point, otherwise you wouldn't get the interface to issue shares. Right? But then once the button has been clicked, actions is run again and you no longer get have sell_shares included.

@philcampeau philcampeau linked a pull request Mar 7, 2025 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Prevents game from being played correctly Steam Over Holland
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants