From 591c1201f4c363e86d5c6bdb2e73025b6c545e9a Mon Sep 17 00:00:00 2001 From: cha0s Date: Mon, 5 Aug 2024 22:47:55 -0500 Subject: [PATCH] fix: reset rotation --- app/react/components/pixi/entity.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/react/components/pixi/entity.js b/app/react/components/pixi/entity.js index a9e1049..7370d11 100644 --- a/app/react/components/pixi/entity.js +++ b/app/react/components/pixi/entity.js @@ -163,11 +163,16 @@ export default class Entity { }); } } + if (!this.attached) { + const {diffuse, normals} = this; + diffuse.rotation = 0; + normals.rotation = 0; + } if (Direction) { const {diffuse, normals} = this; - if ('direction' in Direction) { + if (!this.attached || 'direction' in Direction) { if (this.entity.Sprite.rotates) { - const rotation = Direction.direction + this.entity.Sprite.rotation; + const rotation = this.entity.Direction.direction + this.entity.Sprite.rotation; diffuse.rotation = rotation; normals.rotation = rotation; }