Skip to content

Commit

Permalink
added null check for frostbeams, hide beam if condition not verified
Browse files Browse the repository at this point in the history
  • Loading branch information
EliphasNUIT committed Jun 16, 2024
1 parent b7f0aa4 commit 4ebe5fd
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
4 changes: 2 additions & 2 deletions GW2EIEvtcParser/EIData/CombatReplay/CombatReplay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ internal CombatReplay(ParsedEvtcLog log)

internal void Trim(long start, long end)
{
PolledPositions.RemoveAll(x => x.Time < start || x.Time > end);
PolledRotations.RemoveAll(x => x.Time < start || x.Time > end);
_start = Math.Max(start, _start);
_end = Math.Max(_start, Math.Min(end, _end));
PolledPositions.RemoveAll(x => x.Time < _start || x.Time > _end);
PolledRotations.RemoveAll(x => x.Time < _start || x.Time > _end);
}

private static int UpdateVelocityIndex(List<ParametricPoint3D> velocities, int time, int currentIndex)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -882,13 +882,18 @@ internal override void ComputeNPCCombatReplayActors(NPC target, ParsedEvtcLog lo
case (int)ArcDPSEnums.TrashID.JormagMovingFrostBeamCenter:
VelocityEvent frostBeamMoveStartVelocity = log.CombatData.GetMovementData(target.AgentItem).OfType<VelocityEvent>().FirstOrDefault(x => x.GetPoint3D().Length() > 0);
// Beams are immobile at spawn for around 3 seconds
(long start, long end) lifespanBeam = (frostBeamMoveStartVelocity.Time, target.LastAware);
if (frostBeamMoveStartVelocity != null)
{
(long start, long end) lifespanBeam = (frostBeamMoveStartVelocity.Time, target.LastAware);
replay.Trim(lifespanBeam.start, lifespanBeam.end);
var beamAoE = new CircleDecoration(300, lifespanBeam, Colors.LightBlue, 0.1, new AgentConnector(target));
replay.AddDecorationWithBorder(beamAoE, Colors.Red, 0.5);
}
else
{
// Completely hide it
replay.Trim(0, 0);
}
var beamAoE = new CircleDecoration(300, lifespanBeam, Colors.LightBlue, 0.1, new AgentConnector(target));
replay.AddDecorationWithBorder(beamAoE, Colors.Red, 0.5);
break;
case (int)ArcDPSEnums.TrashID.DragonEnergyOrb:
(int dragonOrbStart, int dragonOrbEnd) = ((int)target.FirstAware, (int)target.LastAware);
Expand Down
2 changes: 1 addition & 1 deletion GW2EIEvtcParser/GW2EIEvtcParser.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Nullable>disable</Nullable>
<Version>0.52.1</Version>
<Version>0.52.2</Version>
<Configurations>Debug;Release;NoRewards</Configurations>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion GW2EIParser/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("6135677e-6c0e-42de-925e-1995e52e5ac5")]
#if !DEBUG
[assembly: AssemblyVersion("2.69.1.0")]
[assembly: AssemblyVersion("2.69.1.1")]
#else
[assembly: AssemblyVersion("2.69.*")]
#endif
Expand Down

0 comments on commit 4ebe5fd

Please sign in to comment.