Skip to content

Commit

Permalink
fix: 入力デバイスPI版でシナリオを再読込するとエラーが発生する不具合を修正
Browse files Browse the repository at this point in the history
  • Loading branch information
automatic9045 committed Oct 11, 2023
1 parent f0e2fc3 commit 573056d
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions AtsEx/BveHacker/BveHacker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ static BveHacker()

private readonly StructureSetLifeProlonger StructureSetLifeProlonger;

private ScenarioInfo TargetScenarioInfo = null;

public BveHacker(BveTypeSet bveTypes)
{
BveTypes = bveTypes;
Expand Down Expand Up @@ -85,8 +87,9 @@ public BveHacker(BveTypeSet bveTypes)
LoadScenarioPatch.Invoked += (sender, e) =>
{
ScenarioInfo scenarioInfo = ScenarioInfo.FromSource(e.Args[0]);
_MapHeaders = HeaderSet.FromMap(scenarioInfo.RouteFiles.SelectedFile.Path);
TargetScenarioInfo = scenarioInfo;

_MapHeaders = HeaderSet.FromMap(scenarioInfo.RouteFiles.SelectedFile.Path);
ScenarioHacker.BeginObserveInitialization();

ScenarioOpened?.Invoke(this, EventArgs.Empty);
Expand All @@ -96,8 +99,13 @@ public BveHacker(BveTypeSet bveTypes)

DisposeScenarioPatch.Invoked += (sender, e) =>
{
_MapHeaders = null;
_MapStatements = null;
if (ScenarioInfo == TargetScenarioInfo)
{
_MapHeaders = null;
_MapStatements = null;

TargetScenarioInfo = null;
}

ScenarioClosed?.Invoke(this, EventArgs.Empty);

Expand Down

0 comments on commit 573056d

Please sign in to comment.