Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed FlxTilemap.ray() result value always null #84

Merged
merged 1 commit into from Sep 17, 2012

Conversation

moly
Copy link
Member

@moly moly commented Sep 16, 2012

See: AdamAtomic#224 (comment)

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.

… 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.
@IQAndreas
Copy link
Member

The change looks good.

On a related note, I'm not a fan of meddling with references like that, especially not for simple objects such as FlxPoint. Wouldn't it be better if ray() was used to see where a collision occurred, rather than if it occurred? In that case, if it collided, it returns the FlxPoint at which it happened. If there was no collision, it returns null.

This change would also help avoid the mistake the user made.

@Dovyski
Copy link
Member

Dovyski commented Sep 17, 2012

I agree with @IQAndreas . I think it will make things much better to understand.

IQAndreas added a commit that referenced this pull request Sep 17, 2012
Fixed `FlxTilemap.ray()` result value always null
@IQAndreas IQAndreas merged commit e5a7345 into FlixelCommunity:dev Sep 17, 2012
@IQAndreas IQAndreas mentioned this pull request Oct 15, 2013
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants