Skip to content

Commit f7fe982

Browse files
committed
Fix for lightning system.
1 parent 24a23a5 commit f7fe982

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22
<PropertyGroup>
3-
<Version>3.3.4</Version>
3+
<Version>3.3.5</Version>
44
<UsePackageReferences>false</UsePackageReferences>
55
<PackageLicenseFile>LICENSE</PackageLicenseFile>
66
<PackageProjectUrl>https://github.com/Orden4/WCSharp</PackageProjectUrl>

WCSharp.Lightnings/Lightning.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using WCSharp.Api;
1+
using System;
2+
using WCSharp.Api;
23
using WCSharp.Shared;
34
using WCSharp.Timers;
45
using static WCSharp.Api.Common;
@@ -8,7 +9,7 @@ namespace WCSharp.Lightnings
89
/// <summary>
910
/// Represents a single lightning instance. Add to <see cref="LightningSystem"/> to activate.
1011
/// </summary>
11-
public class Lightning : ICollectiveAction
12+
public class Lightning : ICollectiveDisposableAction
1213
{
1314
/// <inheritdoc/>
1415
public bool Active { get; set; }
@@ -216,7 +217,7 @@ public void Action()
216217
this.age += LightningSystem.TickInterval;
217218
if (this.age > Duration - FadeDuration)
218219
{
219-
Alpha -= this.transparencyRate;
220+
Alpha = MathF.Max(0, Alpha - this.transparencyRate);
220221
SetLightningColor(this.lightning, Red, Green, Blue, Alpha);
221222
}
222223

0 commit comments

Comments
 (0)