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

AI: Regular order becomes go to nearest depot #3438

Closed
DorpsGek opened this issue Dec 27, 2009 · 4 comments
Closed

AI: Regular order becomes go to nearest depot #3438

DorpsGek opened this issue Dec 27, 2009 · 4 comments
Labels
component: AI/Game script (squirrel) This issue is related to Squirrel (Scripting language) flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

Zuu opened the ticket and wrote:

Under some circumstances, when inserting bus stops a "go to nearest depot" order is inserted instead.

How to reproduce:
* Use r27 of PAXLink from SVN (or get it from attached files)
* Load the attached save

- preferable open the AI debug window and select the PAXLink AI.
- preferable open the sign list window
- open the bus order window of the bus.
- (unpause) and run until the sign "break" appears.
- pause
- remove the "break" sign
- unpause for short moments of time until the first change is made to the vehicle orders.

A sign will be placed on the bus stop first showing "flags 17". A moment later it is changed to "insert 17" just before the call to AIOrder.InsertOrder. The tile where the sign is placed is used as destination and the printed number is the flags that are used.

What you will see is an order to go to the nearest depot. What is expected is an order to go to the bus station with the flags to go there non-stop and no unloading.

Attachments

Reported version: trunk
Operating system: All


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

Zuu wrote:

Hope this tar should work better. The first one seams to have been corrupt.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/3438#comment7149

@DorpsGek
Copy link
Member Author

SmatZ wrote:

AIOF_NO_UNLOAD = 1 << 4,
AIOF_GOTO_NEAREST_DEPOT = 1 << 4,

OrderType ot = (order_flags & AIOF_GOTO_NEAREST_DEPOT) ? OT_GOTO_DEPOT : ::GetOrderTypeByTile(destination);

looks the logic for determining order type is broken


This comment was imported from FlySpray: https://bugs.openttd.org/task/3438#comment7150

@DorpsGek
Copy link
Member Author

SmatZ wrote:

Attached diff fixes the problem

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/3438#comment7151

@DorpsGek
Copy link
Member Author

SmatZ closed the ticket.

Reason for closing: Fixed

In r18651. Thanks for the bugreport.


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

@DorpsGek DorpsGek added flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) bug component: AI/Game script (squirrel) This issue is related to Squirrel (Scripting language) labels Apr 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: AI/Game script (squirrel) This issue is related to Squirrel (Scripting language) flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

1 participant