Skip to content

Commit

Permalink
fixed FlixelCommunity#8, AdamAtomic#224 FlxTilemap.ray() result value…
Browse files Browse the repository at this point in the history
… always null

I believe this issue was caused by the user mistakenly passing in a null pointer. I've just updated the code slightly to make it more obvious how it works, and to remove an unnecessary FlxPoint creation.
  • Loading branch information
moly committed Sep 16, 2012
1 parent 2c1e5dc commit 926ba9c
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions org/flixel/FlxTilemap.as
Expand Up @@ -1278,10 +1278,11 @@ package org.flixel
ry = ly + stepY*((q-lx)/stepX);
if((ry > tileY) && (ry < tileY + _tileHeight))
{
if(Result == null)
Result = new FlxPoint();
Result.x = rx;
Result.y = ry;
if(Result != null)
{
Result.x = rx;
Result.y = ry;
}
return false;
}

Expand All @@ -1293,10 +1294,11 @@ package org.flixel
ry = q;
if((rx > tileX) && (rx < tileX + _tileWidth))
{
if(Result == null)
Result = new FlxPoint();
Result.x = rx;
Result.y = ry;
if(Result != null)
{
Result.x = rx;
Result.y = ry;
}
return false;
}
return true;
Expand Down

0 comments on commit 926ba9c

Please sign in to comment.