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

GSNews.Create with wrong NewsType crashes OpenTTD #5054

Closed
DorpsGek opened this issue Feb 8, 2012 · 2 comments
Closed

GSNews.Create with wrong NewsType crashes OpenTTD #5054

DorpsGek opened this issue Feb 8, 2012 · 2 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

DorpsGek commented Feb 8, 2012

xOR opened the ticket and wrote:

Calling GSNews.Create with some specific news types crashes OpenTTD with an assertion failure (tested on Windows XP on 1.2.0 beta4). I haven't tried every single type, but for example NT_ACCIDENT, NT_ADVICE and cause the crash while other types work fine. As Zuu suggested (http://www.tt-forums.net/viewtopic.php?f=33&t=57431&sid=bfc7507ce86d76a845a7adea7baa90e8&start=280# p994632) it might be types that internally expect an additional parameter like a vehicle index, which cannot be provided through GSNews.Create().

Script to reproduce: just create an empty script or take any existing script and add this line:
GSNews.Create(GSNews.NT_ADVICE, "test", GSCompany.COMPANY_INVALID);

It causes the error message:
Assertion failed at line 103 of c:bamboo-agent-homexml-databuild-dirottd-rls-w32bitsrccore/pool_type.hpp: index < this->first_unused

Reported version: 1.2.0-beta4
Operating system: All


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

DorpsGek commented Feb 9, 2012

Rubidium wrote:

It's basically whenever you use a news type that has a viewport and the news window is shown. So it's not only those by most of them could crash.


This comment was imported from FlySpray: https://bugs.openttd.org/task/5054#comment10881

@DorpsGek
Copy link
Member Author

Rubidium closed the ticket.

Reason for closing: Fixed

In r23924


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

@DorpsGek DorpsGek added flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) Goal/Game script labels Apr 7, 2018
@frosch123 frosch123 added the component: AI/Game script (squirrel) This issue is related to Squirrel (Scripting language) label Apr 14, 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

2 participants