-
-
Notifications
You must be signed in to change notification settings - Fork 957
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
Conversation
src/ai/ai_instance.cpp
Outdated
@@ -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; |
There was a problem hiding this comment.
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.
c2f7522
to
46a161c
Compare
46a161c
to
ab8491c
Compare
This pull request has been automatically marked as stale because it has not had any activity in the last month. |
I have https://github.com/glx22/OpenTTD/commits/ccai_check that may be a solution, but not really tested. |
6f288ac
to
7b67c07
Compare
This pull request has been automatically marked as stale because it has not had any activity in the last month. |
7b67c07
to
a3c3c68
Compare
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? |
No description provided.