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 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 PeterN:pr7204-done-differently branch 2 times, most recently from dcd0696 to f5c5f56 Feb 21, 2019
@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 PeterN force-pushed the PeterN:pr7204-done-differently branch from f5c5f56 to f6b21fe Mar 3, 2019
@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.

@PeterN PeterN force-pushed the PeterN:pr7204-done-differently branch from f6b21fe to 83e0599 Mar 4, 2019
@PeterN PeterN added the needs review label Mar 7, 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 force-pushed the PeterN:pr7204-done-differently branch from 83e0599 to d031048 Mar 8, 2019
@nielsmh
nielsmh approved these changes Mar 8, 2019
@PeterN PeterN merged commit dd20cce into OpenTTD:master Mar 8, 2019
8 checks passed
8 checks passed
OpenTTD CI Build #20190308.12 succeeded
Details
OpenTTD CI (Linux commit-checker) Linux commit-checker succeeded
Details
OpenTTD CI (Linux linux-amd64-clang-3.8) Linux linux-amd64-clang-3.8 succeeded
Details
OpenTTD CI (Linux linux-amd64-gcc-6) Linux linux-amd64-gcc-6 succeeded
Details
OpenTTD CI (Linux linux-i386-gcc-6) Linux linux-i386-gcc-6 succeeded
Details
OpenTTD CI (MacOS) MacOS succeeded
Details
OpenTTD CI (Windows Win32) Windows Win32 succeeded
Details
OpenTTD CI (Windows Win64) Windows Win64 succeeded
Details
@PeterN PeterN deleted the PeterN:pr7204-done-differently branch Mar 8, 2019
@PeterN PeterN removed the needs review label Mar 10, 2019
nielsmh added 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 added 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
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.