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

Fix #7188: AI instance crash when reloading AI in a server. #7190

Closed
wants to merge 1 commit into from

Conversation

SamuXarick
Copy link
Contributor

@SamuXarick SamuXarick commented Feb 7, 2019

No description provided.

@@ -258,7 +258,7 @@ void CcAI(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2)
* when the company does not exist anymore.
*/
const Company *c = Company::GetIfValid(_current_company);
if (c == NULL || c->ai_instance == NULL) return;
if (c == NULL || c->ai_instance == NULL || !c->ai_instance->IsWaiting()) return;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't add any checks to make sure it's the same ai_instance as that which called the command in the first place.

@TrueBrain
Copy link
Member

Can you check if #7298 fixes #7188 too? So instead of this PR, that #7298 is also sufficient? Tnx!

@SamuXarick
Copy link
Contributor Author

Can you check if #7298 fixes #7188 too? So instead of this PR, that #7298 is also sufficient? Tnx!

It fixes the client crash. The server crash still happens.

@SamuXarick SamuXarick changed the title Fix #7188: AI instance crash when reloading AI in a server, and an AI… Fix #7188: AI instance crash when reloading AI in a server. Mar 4, 2019
@stale
Copy link

stale bot commented Apr 3, 2019

This pull request has been automatically marked as stale because it has not had any activity in the last month.
Please feel free to give a status update now, ping for review, or re-open when it's ready.
It will be closed if no further activity occurs within 7 days.
Thank you for your contributions.

@stale stale bot added the stale Stale issues label Apr 3, 2019
@glx22
Copy link
Contributor

glx22 commented Apr 5, 2019

I have https://github.com/glx22/OpenTTD/commits/ccai_check that may be a solution, but not really tested.

@stale stale bot removed the stale Stale issues label Apr 5, 2019
@SamuXarick SamuXarick force-pushed the network-ai-crashes branch 2 times, most recently from 6f288ac to 7b67c07 Compare April 13, 2019 23:25
@stale
Copy link

stale bot commented May 13, 2019

This pull request has been automatically marked as stale because it has not had any activity in the last month.
Please feel free to give a status update now, ping for review, or re-open when it's ready.
It will be closed if no further activity occurs within 7 days.
Thank you for your contributions.

@stale stale bot added the stale Stale issues label May 13, 2019
@LordAro
Copy link
Member

LordAro commented Aug 17, 2019

I'm going to close this, as there's been no activity on it for a few months. Between Peter's comments & glx's branch, I agree that the other branch looks like a better (and more general) solution.

@glx22 would you mind PRing that?

@LordAro LordAro closed this Aug 17, 2019
@SamuXarick SamuXarick deleted the network-ai-crashes branch December 31, 2019 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Stale issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants