fix: no direction set for zero vector
This commit is contained in:
parent
f15b23c437
commit
414a1eb5a0
|
@ -37,6 +37,9 @@ export class Directional extends decorate(Trait) {
|
||||||
const listeners = {};
|
const listeners = {};
|
||||||
if (this.params.trackMovement) {
|
if (this.params.trackMovement) {
|
||||||
listeners.movementRequest = (vector) => {
|
listeners.movementRequest = (vector) => {
|
||||||
|
if (Vector.isZero(vector)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.entity.direction = Vector.toDirection(vector, this.directionCount);
|
this.entity.direction = Vector.toDirection(vector, this.directionCount);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user