Closed AaronGullickson closed 7 months ago
Ok, I think whats going on here is because of this in MekHQ.gameVictory
:
gameThread.requestStop();
...
MekHQ.triggerEvent(new ScenarioResolvedEvent(currentScenario));
The GameThread.requestStop()
method calls MekHQ.stopHost()
which is, as far as I can tell, the only place that the currentScenario
object is set to NULL. Because that thread is called before the ScenarioResolvedEven is triggered, the thread might have some possibility of nulling out currentScenario
before the event is triggered. I don't think it happens every time (or even most of the time) because of a threaded nature, but does happen sometimes which explains the seeming randomness.
I believe the way to fix this will be to put the event triggering before the thread is stopped. Off the top of my head, I don't think this will have any other consequences, but I need to do some more checking and testing to be sure.
I ran through this in the debugger and that does appear to be the source of the problem. Moving the trigger immediately before the thread does not cause any problems, so I will do that.
Fixed in 3370fe29ee.
I have noticed that ocassionally, I am not having story arcs progress after the conclusion of a scenario and I get the following in the log:
Most recently, I noticed this with the Defend Ulric scenario on Wotan. However, it doesn't seem to happen consistently.