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

Support for action 2 variable 11 #2091

Closed
DorpsGek opened this issue Jun 18, 2008 · 4 comments
Closed

Support for action 2 variable 11 #2091

DorpsGek opened this issue Jun 18, 2008 · 4 comments
Labels
component: NewGRF This issue is related to NewGRFs flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

mart3p opened the ticket and wrote:

I would like to use action 2 variable 11 to disable certain stations for monorail and maglev rail types. This variable is not currently implemented.

The attached patch adds support for variable 11 and gives the same behaviour as TTDPatch. I'm not sure if it might not be better to make _cur_railtype a global variable though.

There is one other issue I am unsure about here. Currently variable 11 is included with the 'common' variables making it also available for action 7/9 and action D. I can’t see any use for this. Would it not be better to make variable 11 available for action 2 only?

Attachments

Reported version: trunk
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/2091
@DorpsGek
Copy link
Member Author

Rubidium wrote:

This implementation causes desyncs:
Client A has normal rail selected and builds a station.
Client B has maglev selected. Building the station fails on this computer.

Furthermore the behaviour can't be the same as in TTDP because TTDP doesn't have a type '3'. Furthermore monorail is always mapped to # 2 in OTTD, whereas in TTDP it depends on whether there is elrail.

So effectively there needs to be some variable that is set on any station callback and reset after that callback in order to make it MP safe.


This comment was imported from FlySpray: https://bugs.openttd.org/task/2091#comment4331

@DorpsGek
Copy link
Member Author

mart3p wrote:

[Desyncs] Yes, I didn't consider multiplayer, I should have known it wouldn't be that simple.

[Rail type '3'] My assumption here was that TTDPatch would return '0' for normal rail, '1' for electrified, '2' for monorail and '3' for maglev, regardless of the elrail setting, the same as var 42 (it's not actually documented for var 11). Having now tested this further in TTDPatch, it seems my assumption was wrong.

Not an easy one to implement then...


This comment was imported from FlySpray: https://bugs.openttd.org/task/2091#comment4338

@DorpsGek
Copy link
Member Author

Rubidium wrote:

The attached version is MP safe... however:
- it only works for the station availability callback
- it thus doesn't work for the station drawing in the station picker
- it doesn't recheck availability when converting the rail, so you can still build any station for any railtype

Even then, the result would be quite unusable in most cases; 3 return values and 4 rail types is really messy.

So still a large amount of work to do for not much of a benefit. And when we get railtypes it becomes even more messy.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/2091#comment6242

@DorpsGek
Copy link
Member Author

andythenorth closed the ticket.

Reason for closing: Won't implement

Mass closure of patch tickets with no commentary for >5 years. Goal is to reduce patch queue as an experiment to see if it aids faster reviewing and rejection/acceptance (it may not). If this offends you and the patch is maintained and compiles with current trunk, discuss with andythenorth in irc. (andythenorth has no ability to review patches but can re-open tickets).

(Also, railtypes - added complexity)


This comment was imported from FlySpray: https://bugs.openttd.org/task/2091

@DorpsGek DorpsGek added flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) component: NewGRF This issue is related to NewGRFs enhancement labels Apr 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: NewGRF This issue is related to NewGRFs flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

1 participant