Author Topic: FlxSprite.overlapArray() doesn't check for null entries. (v1.1)  (Read 1420 times)

PizzaBoy

  • Guest
Simple fix to prevent error:

Code: [Select]
static public function overlapArray(Array:FlxArray,Sprite:FlxSprite,Collide:Function):void
{
if(!Sprite.exists || Sprite.dead) return;
var spr:FlxSprite;
for(var i:uint = 0; i < Array.length; i++)
{
spr = Array[i];
if(spr == null) continue;
if(!spr.exists || spr.dead) continue;
if(spr.overlaps(Sprite)) Collide(spr,Sprite);
}
}
« Last Edit: Sun, Jun 28, 2009 by PizzaBoy »