From 414a1eb5a0ccb6d9a3277f7d4bd59a176ef9d978 Mon Sep 17 00:00:00 2001 From: cha0s Date: Thu, 9 May 2019 15:15:51 -0500 Subject: [PATCH] fix: no direction set for zero vector --- packages/entity/traits/directional.trait.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/entity/traits/directional.trait.js b/packages/entity/traits/directional.trait.js index dbc642f..9df3a89 100644 --- a/packages/entity/traits/directional.trait.js +++ b/packages/entity/traits/directional.trait.js @@ -37,6 +37,9 @@ export class Directional extends decorate(Trait) { const listeners = {}; if (this.params.trackMovement) { listeners.movementRequest = (vector) => { + if (Vector.isZero(vector)) { + return; + } this.entity.direction = Vector.toDirection(vector, this.directionCount); }; }