Skip to content

Commit

Permalink
Bugfix related to null particle effect
Browse files Browse the repository at this point in the history
  • Loading branch information
ari-steas committed Oct 16, 2024
1 parent 0e876dd commit f3827ff
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public void DrawUpdate()
{
if (ProjectileEffect == null)
MyParticlesManager.TryCreateParticleEffect(Definition.Visual.AttachedParticle, ref MatrixD.Identity, ref Vector3D.Zero, RenderId, out ProjectileEffect);
if (RenderId == uint.MaxValue)
if (RenderId == uint.MaxValue && ProjectileEffect != null)
ProjectileEffect.WorldMatrix = ProjectileMatrix;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,15 @@ public override void Draw() // Called once per frame to avoid jitter
if (HeartData.I.IsSuspended || MyAPIGateway.Utilities.IsDedicated) // We don't want to needlessly use server CPU time
return;

foreach (var projectile in ActiveProjectiles.Values)
projectile.DrawUpdate(); // Draw delta is always 1/60 because Keen:tm:
try
{
foreach (var projectile in ActiveProjectiles.Values)
projectile.DrawUpdate(); // Draw delta is always 1/60 because Keen:tm:
}
catch (Exception ex)
{
HeartLog.LogException(ex, typeof(ProjectileManager));
}
}

[Obsolete]
Expand Down

0 comments on commit f3827ff

Please sign in to comment.