Don't call an important func as part of an OR test

BlitzMax Forums/BlitzMax Programming/Don't call an important func as part of an OR test

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

All the anims have different counters and so I use an anim var to track the output of all certain anim functions to decide if I should be block player input or not.


Well, I'm not sure how your code works as I'm not fully understanding in your original example why both Anim1() and Anim2() need to be called if either returns true. If either returns true, you know you can block the input right? So why does the second function need to be called anyways?

It seems like you're making a single function handle two tasks - keeping track of the state of the animation and perhaps advancing it forward, as well as reporting the state of that animation. Wouldn't it be better to separate those two tasks...so you'd have something like

UpdateAnimations()

that gets called every frame regardless, and then

IfAnimationsRunning()

which checks the status of the animations?