Skip to content

Commit

Permalink
停電を中断した時に白線が残ってしまうのを修正
Browse files Browse the repository at this point in the history
  • Loading branch information
TORISOUP committed May 24, 2017
1 parent 6f5aee9 commit 7321adf
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Inferno/InfernoScripts/Parupunte/Scripts/BlackOut.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ class BlackOut : ParupunteScript
private SoundPlayer soundPlayerStart;
private SoundPlayer soundPlayerEnd;

private IDisposable drawingDisposable;

public BlackOut(ParupunteCore core) : base(core)
{
SetUpSound();
Expand All @@ -41,6 +43,7 @@ public override void OnStart()
GTA.World.SetBlackout(false);
soundPlayerStart = null;
soundPlayerEnd = null;
drawingDisposable?.Dispose();
});

//周辺車両をエンストさせる
Expand Down Expand Up @@ -107,7 +110,7 @@ private IEnumerable<object> DrawBlackOutLine()
{
var targets = GetAroundObjectPosition(core.PlayerPed.Position, 50, 15);

var d = core.OnDrawingTickAsObservable
drawingDisposable = core.OnDrawingTickAsObservable
.TakeUntil(this.OnFinishedAsObservable)
.Subscribe(_ =>
{
Expand All @@ -124,7 +127,7 @@ private IEnumerable<object> DrawBlackOutLine()
targets = GetAroundObjectPosition(core.PlayerPed.Position, 50, 15);

}
d?.Dispose();
drawingDisposable?.Dispose();
}

/// <summary>
Expand Down

0 comments on commit 7321adf

Please sign in to comment.