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 = {};
|
||||
if (this.params.trackMovement) {
|
||||
listeners.movementRequest = (vector) => {
|
||||
if (Vector.isZero(vector)) {
|
||||
return;
|
||||
}
|
||||
this.entity.direction = Vector.toDirection(vector, this.directionCount);
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user