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

Fix: Stopped ships shouldn't block depots #8578

Merged
merged 1 commit into from Feb 14, 2021

Conversation

2TallTyler
Copy link
Member

Motivation / Problem

Ships are only allowed to leave a depot when there are no visible ships on the depot tile. This prevents every ship in the depot from leaving simultaneously if the player clicks the green flag to start all ships inside the depot.

Previously, if a ship was stopped immediately after leaving the depot while still on the depot tile, it would block any other ships from leaving the depot.

Description

This changes the depot start check to only consider visible ships which are not stopped. Any stopped vehicles will be ignored, the same as hidden ships.

Limitations

Checklist for review

Some things are not automated, and forgotten often. This list is a reminder for the reviewers.

  • The bug fix is important enough to be backported? (label: 'backport requested')
  • This PR affects the save game format? (label 'savegame upgrade')
  • This PR affects the GS/AI API? (label 'needs review: Script API')
    • ai_changelog.hpp, gs_changelog.hpp need updating.
    • The compatibility wrappers (compat_*.nut) need updating.
  • This PR affects the NewGRF API? (label 'needs review: NewGRF')

src/ship_cmd.cpp Outdated Show resolved Hide resolved
@LC-Zorg
Copy link

LC-Zorg commented Jan 15, 2021

I don't know if this is really a problem. Either way, maybe there might be a better solution for providing spacing. I also don't know if my reasoning is correct, but if you replace the limitation of the simultaneous departure of ships by blocking the position (?) with a time block, if possible, it would be good to make the time of the blockade dependent on the speed of the ship that set out and possibly the value that would be defined by newGRF (it is about the length of the ship). As a result, such a solution would provide better spacing between ships. :)

@LordAro
Copy link
Member

LordAro commented Jan 16, 2021

You know, I'm inclined to agree. A train, road vehicle or aircraft stopped in front of a depot effectively blocks everything else from exiting, why be inconsistent here?

@2TallTyler
Copy link
Member Author

2TallTyler commented Jan 16, 2021

Players expect ships to clip through each other, inconsistent with other vehicles. This is the only situation in which they're blocked, with no explanation to the player.

src/ship_cmd.cpp Outdated Show resolved Hide resolved
@michicc michicc added candidate: most likely This Pull Request is probably going to be accepted size: small This Pull Request is small, and should be relative easy to process labels Feb 14, 2021
Copy link
Member

@michicc michicc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ships don't block each other everywhere else. The code comment suggests this is more of a performance optimisation than anything else. As such, not blocking the depot is consistent for other ship behaviour.

@TrueBrain TrueBrain merged commit ce06b03 into OpenTTD:master Feb 14, 2021
@2TallTyler 2TallTyler deleted the blocked_ship_depot branch February 14, 2021 23:47
@2TallTyler 2TallTyler restored the blocked_ship_depot branch February 24, 2021 21:44
@2TallTyler 2TallTyler deleted the blocked_ship_depot branch February 27, 2021 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
candidate: most likely This Pull Request is probably going to be accepted size: small This Pull Request is small, and should be relative easy to process
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants