Skip to content

Removed useless condition - #16

Open
Overkane wants to merge 1 commit into
Frotty:masterfrom
Overkane:master
Open

Removed useless condition#16
Overkane wants to merge 1 commit into
Frotty:masterfrom
Overkane:master

Conversation

@Overkane

Copy link
Copy Markdown

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