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

Feature: Game setting to define how industries with neutral stations accept and supply cargo from/to surrounding stations. #7234

Merged
merged 1 commit into from Mar 8, 2019

Conversation

PeterN
Copy link
Member

@PeterN PeterN commented Feb 16, 2019

Based on #7204 but done by keeping a direct two-way reference between industry and station. This removes associated tile loops to determine where neutral stations are linked.

src/station_cmd.cpp Outdated Show resolved Hide resolved
@nielsmh
Copy link
Contributor

nielsmh commented Feb 16, 2019

I definitely like this better than #7204, it avoids propagating the concern into the base tile acceptance query function. And there's a savegame upgrade anyway for the setting, so no real additional complexity for adding another field.

@PeterN
Copy link
Member Author

PeterN commented Feb 16, 2019

@nielsmh Less lines added as well (although many were comments), and less tile iterating, for a tiny memory cost.

@PeterN
Copy link
Member Author

PeterN commented Feb 19, 2019

I am thinking about changing this to store IDs rather than pointers, depending on how the values are used it may make more sense.

src/saveload/saveload.h Outdated Show resolved Hide resolved
@PeterN PeterN force-pushed the pr7204-done-differently branch 2 times, most recently from dcd0696 to f5c5f56 Compare February 21, 2019 02:21
@PeterN
Copy link
Member Author

PeterN commented Feb 21, 2019

Thinking about this, I'm tempted to say the default should be the new behviour, with the option there to allow the old 'broken' behaviour.

@nielsmh nielsmh added this to the 1.10.0 milestone Feb 27, 2019
@nielsmh
Copy link
Contributor

nielsmh commented Mar 3, 2019

Any more needs to be done on this, apart from fix saveload.h?

@PeterN
Copy link
Member Author

PeterN commented Mar 3, 2019

I believe it is complete, but as usual more eyes are better. It had bugfix commits which have already been squashed.

michicc
michicc previously approved these changes Mar 8, 2019
@michicc
Copy link
Member

michicc commented Mar 8, 2019

Sorry, saveload conflict.

…accept cargo to/from their neutral station.

This change is a controlled by a game setting, located under Environment ->
Industries which allows toggling the behaviour. It defaults to enabled.

"Company stations can serve industries with attached neutral stations"

When enabled, industries with attached neutral station (such as Oil Rigs) may
also be served by company-owned stations built nearby. This is the traditional
behaviour.

When disabled, these industries may only be served by their neutral station.
Any nearby company-owned stations won't be able to serve them, nor will the
neutral station serve anything else other than the industry.
@PeterN PeterN merged commit dd20cce into OpenTTD:master Mar 8, 2019
@PeterN PeterN deleted the pr7204-done-differently branch March 8, 2019 18:55
nielsmh pushed a commit to nielsmh/OpenTTD that referenced this pull request Mar 11, 2019
…accept cargo to/from their neutral station. (OpenTTD#7234)

This change is a controlled by a game setting, located under Environment ->
Industries which allows toggling the behaviour. It defaults to enabled.

"Company stations can serve industries with attached neutral stations"

When enabled, industries with attached neutral station (such as Oil Rigs) may
also be served by company-owned stations built nearby. This is the traditional
behaviour.

When disabled, these industries may only be served by their neutral station.
Any nearby company-owned stations won't be able to serve them, nor will the
neutral station serve anything else other than the industry.
douiwby pushed a commit to douiwby/OpenTTD that referenced this pull request Apr 16, 2020
…accept cargo to/from their neutral station. (OpenTTD#7234)

This change is a controlled by a game setting, located under Environment ->
Industries which allows toggling the behaviour. It defaults to enabled.

"Company stations can serve industries with attached neutral stations"

When enabled, industries with attached neutral station (such as Oil Rigs) may
also be served by company-owned stations built nearby. This is the traditional
behaviour.

When disabled, these industries may only be served by their neutral station.
Any nearby company-owned stations won't be able to serve them, nor will the
neutral station serve anything else other than the industry.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants