Comments (6)
At https://18xx.games/game/133915?action=95 the displayed available trains look correct (ie just the 2-trains from the depot and other corporations), but when processing the buy train action it should probably enforce that the bought train is a legitimate one--that'll likely be the fix for this bug.
Not sure how this could have happened, one way is you could probably make a POST request with the right data but it doesn't sound like that was the cause here.
from 18xx.
@Ticketautomat1 you should undo to right before you bought the 3-train, and then you can proceed with the game like normal. If you don't undo and remove that illegal action from history, your game will break when the fix is deployed.
saved the game JSON here - https://gist.github.com/michaeljb/5a8cffb8d2d47ae25df331befec4db40
from 18xx.
I tried a simple approach in michaeljb@30e7f33
It broke 6 fixtures
- 18Ireland (
39547
andhs_ljvktyhv_38235
) - twice a 4H train was bought while one more 2H train was available, in the UI it looks like the 4H should not have been available, just like in the 1830 game here - 1880 (
1
) and 18EU (74045
) - in each of these a train of the correct rank was bought, but not the next one on the stack, ie in 1880 they were on the 6-trains and6-4
was bought instead of6-3
- 18Mag (
76622
) and Harzbahn 1873 (hs_gwlftpex_33770
) look like this change actually breaks them when it shouldn't
from 18xx.
Here's a weird one, one 5T left while all 6Ts are gone (currently only in my local env). https://gist.github.com/michaeljb/a4e4a477d2926ab8cd44b78362cda6f0
This is because of #10609 and it's only getting into that exact state because of my local testing a fix (note: because of this fix, checking out this game in the future may require checking out commit 905dbbe or another master commit around this time), but if this train availability issue were fixed, then that game would break as soon as someone tried to buy a 6T instead of a 5T, which would be ideal.
from 18xx.
A fix that might be more backward compatible would be to enforce that the train being bought has the same name as the first in the depot, even if itβs not the same train by ID. OTOH this probably leaves a vulnerability for events that happen on a train other than the first of its type, eg 18NY or 18RoyalGorge
from 18xx.
Copying a note from @crericha in case it is useful for working on the underlying issue after #10889 is merged:
The potential ordering bug is then that we assume
depot.available_upcoming_trains()
is sorted lowest index train first. I don't see any explicit sorting, so maybe that's how the ordering is getting messed up?
@upcoming.group_by(&:name).values().map {|group| group.min_by(&:index)}.select { |t| t.name == @upcoming.first.name || @game.phase_available?(t.available_on) }
from 18xx.
Related Issues (20)
- 18 Hiawatha - Link for Rules is broken HOT 1
- System18: Add map Northern Italy by Ian D. Wilson
- 18India player turn does not update HOT 2
- [1822CA] Montreal tile labels overlap
- [1822] Mis-calculating player value HOT 2
- [18Ardennes] Unable to issue shares after in second operating round and beyond HOT 2
- 18ESP - game id 177789 will not load HOT 3
- [1822NRS] City name misspelled
- [1860] Auto-routing doesn't use the single city bypass HOT 3
- Please close game 173881
- 1858 Swiss with Robot: buying SBB shares HOT 2
- [1822][1822MX] Will 2-player variants be added in the future? HOT 1
- [18 India] Game will not proceed HOT 1
- 18 India GIPR not allowed to place station before building tracK HOT 3
- [1862] System allows company to keep four trains in phase G and H after a late merge. HOT 1
- Add colors to games that you haven't opened and where you were pinged.
- [1849] Game can't proceed
- Show some top players' games for green hands to learn
- Feature request: profile option to suppress currency symbols
- [18ESP] "undefined method `hex_by_id' for nil" when attempting to lay down track
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from 18xx.