Skip to content

Commit

Permalink
Fix an NRE spam when an active engine go out of physic range
Browse files Browse the repository at this point in the history
  • Loading branch information
sarbian committed Jul 21, 2015
1 parent cf4da10 commit fa03ea2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ModelMultiParticlePersistFX.cs
Expand Up @@ -349,6 +349,9 @@ public void UpdateEmitters(float power)
{
PersistentKSPParticleEmitter pkpe = persistentEmitters[i];

if (pkpe.go == null)
continue;

//pkpe.pe.useWorldSpace
float finalScale = fixedScale * specialScale;

Expand Down Expand Up @@ -446,6 +449,9 @@ public void Update()

for (int i = 0; i < persistentEmitters.Count; i++)
{
if (persistentEmitters[i].go == null)
continue;

// using Camera.main will mess up anything multi cam but using current require adding a OnWillRenderObject() to the ksp particle emitter GameObject (? not tested)
float currentAngle = Vector3.Angle(
-Camera.main.transform.forward,
Expand Down

0 comments on commit fa03ea2

Please sign in to comment.