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

Removed useless condition #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

Overkane
Copy link
Contributor

If we are talking about using function physicsUpdate() in update() function in a class, which extend Entity, then you can't call it before super.update(), because it update coords and etc.
So you have to call physicsUpdate() after. Thus this kind of condition appeared to check of object wasn't destroyed after super call. But actually this check is useless, cuz it takes properties of object, which, if destroyed in super call, will be null.

So have to make outer checks like that anyway:

super.update()
if not done
     physicsUpdate(this)

Then it works fine. Or do you think it can be used somewhere else, not in update() function?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant