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

Crash at clicking "New Vehicles" button #4016

Closed
DorpsGek opened this issue Aug 8, 2010 · 3 comments
Closed

Crash at clicking "New Vehicles" button #4016

DorpsGek opened this issue Aug 8, 2010 · 3 comments
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

DorpsGek commented Aug 8, 2010

ABCRic opened the ticket and wrote:

I was playing around with a scenario I downloaded ( http://wiki.openttd.org/Scenario:Kritschgau ) and thought I'd create some traffic.
Have some vehicles ride around and watch them.

So I built a depot, a road going from the depot to a freeway (one-way so the vehicles don't go back to the depot) and was going to make some vehicles.
I clicked the depot, and as soon as I hit the "New Vehicles" button, the game crashed.
I have uploaded crash.dmp, crash.log, crash.png and the save I made while reproducing the crash.

To reproduce, just follow the instruction the signs show. (Required NewGRFs are included in the scenario download in the link above)

Problem occurred in r20395, running under Windows Vista.

Attachments

Reported version: Version?
Operating system: All


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

DorpsGek commented Aug 8, 2010

Alberth wrote:

The crash happens when drawing the vehicles in the buy vehicle window (trunk r20415).

As the screenshot shows, the Hereford Leopard bus, and the Foster bus have a weird size.

After adding some debugging output in src/roadveh_cmd.cpp, around line 152:

- preferred_x = Clamp(preferred_x, left - real_sprite->x_offs, right - real_sprite->width - real_sprite->x_offs);
+ fprintf(stderr, "a=%d, min=%d, max=%d (left=%d, right=%d, x_offs=%d, width=%d\n", preferred_x, left - real_sprite->x_offs, right - real_sprite->width - real_sprite->x_offs, left, right, real_sprite->x_offs, real_sprite->width);
+
+ if (left <= right - real_sprite->width) preferred_x = Clamp(preferred_x, left - real_sprite->x_offs, right - real_sprite->width - real_sprite->x_offs);
+ else preferred_x = left - real_sprite->x_offs;
+

Outputs:
a=31, min=16, max=211 (left=2, right=225, x_offs=-14, width=28
a=31, min=2, max=-359 (left=2, right=225, x_offs=0, width=584
a=31, min=2, max=-359 (left=2, right=225, x_offs=0, width=584
a=31, min=16, max=211 (left=2, right=225, x_offs=-14, width=28
(and more of the last line)

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/4016#comment8486

@DorpsGek
Copy link
Member Author

DorpsGek commented Aug 8, 2010

Alberth closed the ticket.

Reason for closing: Duplicate

of #3683, NewGRF "ECS Construction vector beta 5 (04 Apr 2009)" is broken. Upgrade to a newer one.


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

@DorpsGek DorpsGek closed this as completed Aug 8, 2010
@DorpsGek
Copy link
Member Author

DorpsGek commented Aug 9, 2010

ABCRic wrote:

NewGRF "ECS Construction vector beta 5 (04 Apr 2009)" is broken. Upgrade to a newer one.

That NewGRF is not in the list, nor was being used.
Nevertheless, I changed all the ECS GRFs to the updated ones, and now the problem does not occur.
Thanks.


This comment was imported from FlySpray: https://bugs.openttd.org/task/4016#comment8488

@DorpsGek DorpsGek added Core flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) labels Apr 7, 2018
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

1 participant