diff options
| author | aldrikboy <aldrikboy@gmail.com> | 2018-01-17 14:26:43 +0100 |
|---|---|---|
| committer | aldrikboy <aldrikboy@gmail.com> | 2018-01-17 14:26:43 +0100 |
| commit | af0ba50d00722e1b7330d1f9b1d23bd3b07a5567 (patch) | |
| tree | fbd7f63dc9bdfc4f1019c03b8f6bf7accb2dce7d /Penguloon/Projectiles/ProjectileBase.cs | |
| parent | a9daa029db68962603905eded0e29c2a2e2abd91 (diff) | |
upgrades
Diffstat (limited to 'Penguloon/Projectiles/ProjectileBase.cs')
| -rw-r--r-- | Penguloon/Projectiles/ProjectileBase.cs | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/Penguloon/Projectiles/ProjectileBase.cs b/Penguloon/Projectiles/ProjectileBase.cs index 4a4f1a2..6427c35 100644 --- a/Penguloon/Projectiles/ProjectileBase.cs +++ b/Penguloon/Projectiles/ProjectileBase.cs @@ -61,21 +61,26 @@ namespace Penguloon.Projectiles for(int i = 0; i < ParentObject.Map.Enemies.Count; i++) { - if (ParentObject.Map.Enemies[i].Dead) continue; - - if (projectileRec.Intersects(ParentObject.Map.Enemies[i].Box)) + try { - ParentObject.Map.Enemies[i].GetHit(); - - this.BaloonsPopped++; + if (ParentObject.Map.Enemies[i] != null) + if (ParentObject.Map.Enemies[i].Dead) continue; - // Remove object if it has hit maximum amount of targets - if(BaloonsPopped >= MaxBalloonPops) + if (projectileRec.Intersects(ParentObject.Map.Enemies[i].Box)) { - ParentObject.Projectiles.Remove(this); - return; + ParentObject.Map.Enemies[i].GetHit(); + + this.BaloonsPopped++; + + // Remove object if it has hit maximum amount of targets + if (BaloonsPopped >= MaxBalloonPops) + { + ParentObject.Projectiles.Remove(this); + return; + } } } + catch { } } } } |
