Open olivernadj opened 6 years ago
But I think there is yet another problem with non-multiFire timer listeners: The startMillis
will not be updated after successful execution of the action. A fraction of a millisecond later when isEventTiggered
is called the next time, isEventTriggered
will again return true
because if(curTime - startMillis > this->millis)
still evaluates the same way. I introduced a hasExecuted
member in the EvtListener
class that gets set when the associated action executes for the first time. Then check for that condition in isEventTriggered
, like this...
bool EvtTimeListener::isEventTriggered() {
if (!this->multiFire && this->hasExecuted) return false;
...
I would like to create a one time event, but it trigger endless fire. Code snipped:
Expected result (after 1s says):
Actual result (immediately prints endless):
I am using version 0.1.5