Comments (9)
Strange. The code is in place, and when I create a new game in hotseat mode, the discount works on this train. I've also played many games of 18VA and never encountered this issue. But when I create a hotseat game using the game data from this game, I can confirm the issue occurs on my end too.
from 18xx.
from 18xx.
Stepping through it in a debugger I found the following:
- The ability doesn't work because
@selected_company
is actually nil at the time of the purchase. @selected_company
is nil becauserender
in app/view/game/round/operating.rb sets it to nil after determining it doesn't have any abilities.- It doesn't have any abilities because
ability_right_time?
looks for when =buy_train
, but the ability has when =buying_train
.
The check in 2) is relatively new, from early September: 7ea0f18
Based on the commit description, it seems entirely possible this is yet another case of clearing @selected_company
when it shouldn't be, due to the mismatch in 3). E.g. the render time check might expect buy_train
while the buy action processing check might require buying_train
, so if we didn't clear the company it would Just Work.
The actual mismatch in 3) is weird. 18NY and variants use buy_train
and everything else uses buying_train
. I don't see any reason these should be different, but I am not at all familiar with train buying abilities.
from 18xx.
Any idea when this will be addressed?
from 18xx.
Same bug here: https://18xx.games/game/146806
from 18xx.
Same bug here: https://18xx.games/game/146806
I don't see the bug in that game. When VR acquired Tredegar Iron Works, it had ~450 and needed 800 to buy a train from the depot.
from 18xx.
The bug was present throughout the game. Anytime the owner of Tredegar tried buying it into any company, and applying the discount to any train, it did not work. We tried all sorts of combinations of owning company and train buying and it never worked.
from 18xx.
https://github.com/tobymao/18xx/blob/master/assets/app/view/game/round/operating.rb#L40
This is the code that wipes out @selected_company and prevents the ability from working.
The bug only triggers when there are zero purchasable companies. In the buggy game there are zero player owned companies. In the functional game there is one.
So it comes down to 7ea0f18 again. That's attempt #3 to get it right, and it turns out didn't work that time either.
Exactly why the train discount doesn't register as an available ability is still puzzling, but we should revert the change above to unbreak games first.
from 18xx.
I'm uploading a fix soon; changing the timing from buying_train
to buy_train
fixes Tredgar; looking at the ability_right_time?
implementation it looks like buying_train
isn't the name of a step or explicitly stated so it doesn't get past this
https://github.com/tobymao/18xx/blob/master/lib/engine/game/base.rb#L3082
from 18xx.
Related Issues (20)
- [1870] Bill Dixon's original 70 rules HOT 1
- [1822CA] Tax Haven value is double counted HOT 1
- min/maxplayer should not be zero
- Min/max player counts not validated on server HOT 7
- [18MEX] Game allows to purchase and sell the same share in a single turn HOT 1
- 1822MX - Cannot place 2-dit tile in M22 from a track to the east of the hex. HOT 4
- 18C2C HOT 1
- 22Mars checklist
- Shikoku 1889 - add corporations icon to the starting locations on the map HOT 1
- Please delete this game [160860] - 18hiawatha, should have been pinned. HOT 1
- [18USA] Add tile information to P16 - Regional Headquarters
- [18USA] Suggestion: minor tile inventory edits
- [1822] [1822CA] Tax Haven value not included in 'total values' table on Spreadsheet tab HOT 1
- [1822] Game incorrectly requests player consent to upgrade a London-adjacent tile HOT 3
- [System18] Poland: right to start corp lapses but text on charter not changed (minor)
- [1822PNW] - Double-credit for destination city? HOT 1
- [18GB] Better text for LB HOT 1
- [1822] Value of Tax Haven subtracted from different player in Entities view
- [1848] Add minimum price information to the private certificates
- [1856] Upgrade or Downgrade of Towns not available in Phase 5 (only 6) HOT 3
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.