Frotty / Frentity

Hierarchical Entity Framework
Apache License 2.0
11 stars 6 forks source link

Removed useless condition #16

Open Overkane opened 1 year ago

Overkane commented 1 year ago

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?