Skip to content

Commit

Permalink
fixed NaN on first process in onTick timeSinceLastTick
Browse files Browse the repository at this point in the history
  • Loading branch information
pfcDorn committed Nov 27, 2024
1 parent 6f661c7 commit 346cbf1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/BasicBehaveEngine/nodes/lifecycle/onTick.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class OnTickNode extends BehaveEngineNode {
const tickTime = Date.now();
if (isNaN(this._startTime)) {
this.outValues.timeSinceStart = {id: "timeSinceStart", value: [0], type: this.getTypeIndex('float')};
this.outValues.timeSinceLastTick = {id: "timeSinceLastTick", value: [NaN], type: this.getTypeIndex('float')};
this.outValues.timeSinceLastTick = {id: "timeSinceLastTick", value: [0], type: this.getTypeIndex('float')};
this._startTime = tickTime;
} else {
this.outValues.timeSinceStart = {id: "timeSinceStart", value: [tickTime - this._startTime], type: this.getTypeIndex('float')};
Expand Down

0 comments on commit 346cbf1

Please sign in to comment.