Page 1 of 1

[NoGo] GSGoal after bankrupt

Posted: 30 Jan 2013 23:12
by idioty
I have a big problem:

I made a script with GSGoal, and all company have specific goals (goal1).
If a company go to bankrupt, then the goal1 automatically destroyed by the OpenTTD.
Then when someone does a new company, this new company was become the goal1.
And I can't remove easy this.
Exist a list what have the all goals?

Re: [NoGo] GSGoal after bankrupt

Posted: 31 Jan 2013 06:49
by Zuu
Currently it is up to GSes to Clean up when a company goes bankrupt. My personal opinion is that it would be better if OpenTTD removed company specific goals when a company goes bankrupt due to the asynchronous behaviour of GSes. Having a new player see old goals etc for a previous company is worse in my opinion than that he/she have to wait some time for them to be created.

I have a patch in preparation to change this in my goal GUI/story book patch queue.

Re: [NoGo] GSGoal after bankrupt

Posted: 31 Jan 2013 08:25
by idioty
Ok, I solved my problem. I wrote wrong code, with GSEventCompanyBankrupt.

But this is interesting, if I don't remove goal from bankrupted company, the nem company receive this goal. I think the new company receive the old company's ID.

sorry I not found the GSes documentation.

Re: [NoGo] GSGoal after bankrupt

Posted: 10 Feb 2013 19:59
by Zuu
As of r24986, company specific goals will now be removed when a company goes bankrupt. (this also applies to company monitors)

This behaviour have been included in the documentation of GSGoal and GSCargoMonitor, just hold on until the next time the public API docs are updated.

(note that as of writing this, there is no nightly yet that contains this change)

Re: [NoGo] GSGoal after bankrupt

Posted: 11 Feb 2013 06:13
by idioty
Ok, thanks!

Re: [NoGo] GSGoal after bankrupt

Posted: 11 Feb 2013 20:22
by Aphid
Will r24986 be included in Ver. 1.3?

(It would be nice for me to know, this little change would be a lot of work (saved) for me)

Re: [NoGo] GSGoal after bankrupt

Posted: 11 Feb 2013 21:00
by Alberth
yep, there is no 1.3 branch yet

Re: [NoGo] GSGoal after bankrupt

Posted: 11 Feb 2013 21:05
by Zuu
Also, see this thread where I've written a bit on this change. Especially, if you plan to support OpenTTD 1.2, its a good idea to read through that post.