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

Orders: after deleting an order which is target of a jump, the jump points to the previous order #6501

Closed
DorpsGek opened this issue Aug 27, 2016 · 1 comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

deep42thought opened the ticket and wrote:

Imho, deleting an order should behave the same as keeping that order in the queue but deleting/ignoring the instruction of the order.
However, deleting an order (say the n-th order), which is target of a (conditional) jump, the jump points to the (n-1)-st order (and not the n-th).

example of orders:
before:

  1. always jump to order 3
  2. go to waypoint1
  3. go to waypoint2
  4. go to waypoint3

after deleting order 3:

  1. always jump to order 2
  2. go to waypoint1
  3. go to waypoint3

expected:

  1. always jump to order 3
  2. go to waypoint1
  3. go to waypoint3

The current behaviour is unintuitive, since "waypoint1" was not reached before the deletion, but afterwards it is. In case the "n-th" is the last order, the target of the jump should change to 1.
Sry for not attaching a patch, but frankly I didn't understand the logic of what happens when I delete an order.

greetings,
deep42thought

Reported version: trunk
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/6501
@DorpsGek DorpsGek added Core flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) labels Apr 7, 2018
@TrueBrain
Copy link
Member

These kind of problems sadly don't have one solution. Sometimes you want it to change to the 3rd, sometimes to the 2nd. Basically, there is no good solution when you remove the order that a conditional jump is pointing to.

For now the code changes it to the one before; in your case it makes more sense to jump to the one after. But I am sure others can find situations where that doesn't make sense.

So sorry, going to close this issue. But feel free to rebuttal!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

2 participants