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 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;

This comment has been minimized.

Copy link
@PeterN

PeterN Feb 7, 2019

Member

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.

src/network/network_client.cpp Outdated Show resolved Hide resolved
@SamuXarick SamuXarick force-pushed the SamuXarick:network-ai-crashes branch from c2f7522 to 46a161c Mar 1, 2019
@TrueBrain

This comment has been minimized.

Copy link
Member

TrueBrain commented Mar 2, 2019

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

@SamuXarick

This comment has been minimized.

Copy link
Contributor Author

SamuXarick commented Mar 3, 2019

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 force-pushed the SamuXarick:network-ai-crashes branch from 46a161c to ab8491c Mar 4, 2019
@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

This comment has been minimized.

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 label Apr 3, 2019
@glx22

This comment has been minimized.

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 label Apr 5, 2019
@SamuXarick SamuXarick force-pushed the SamuXarick:network-ai-crashes branch 2 times, most recently from 6f288ac to 7b67c07 Apr 11, 2019
@stale

This comment has been minimized.

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 label May 13, 2019
@SamuXarick SamuXarick force-pushed the SamuXarick:network-ai-crashes branch from 7b67c07 to a3c3c68 Jul 18, 2019
@LordAro

This comment has been minimized.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.