From 775341338598c770d562feeaa706cb5301988fb8 Mon Sep 17 00:00:00 2001 From: Neckrat Date: Fri, 15 Aug 2025 19:34:56 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BF=D1=83=D0=BF=D1=83=D0=BF=D1=83...=20?= =?UTF-8?q?=D0=BE=D0=B9,=20=D1=82=D0=BE=20=D0=B5=D1=81=D1=82=D1=8C=20pupup?= =?UTF-8?q?u...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit try to fix side draw (after initial side draw) --- lib/character/logic.lua | 10 +++++++++- lib/selector.lua | 5 ----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/character/logic.lua b/lib/character/logic.lua index 2ac7ecc..dcdee36 100644 --- a/lib/character/logic.lua +++ b/lib/character/logic.lua @@ -24,7 +24,15 @@ end function logic:followPath(path) if path:is_empty() then return end self.mapLogic.path = path; - self:runTo(path:peek_front()) + ---@type Vec3 + local nextCell = path:peek_front() + local charPos = self.mapLogic.position + if nextCell.x < charPos.x then + Tree.level.characters[self.id].graphics.animation.side = LEFT + elseif nextCell.x > charPos.x then + Tree.level.characters[self.id].graphics.animation.side = RIGHT + end + self:runTo(nextCell) path:pop_front() end diff --git a/lib/selector.lua b/lib/selector.lua index c9efff8..8784b25 100644 --- a/lib/selector.lua +++ b/lib/selector.lua @@ -30,11 +30,6 @@ function selector:update(dt) if not characterId and self.id then -- временная обработка события "побежать к точке" local char = Tree.level.characters[self.id] local charPos = char.logic.mapLogic.position - if mousePosition.x < charPos.x then - char.graphics.animation.side = LEFT - elseif mousePosition.x > charPos.x then - char.graphics.animation.side = RIGHT - end local path = (require "lib.pathfinder")(charPos, mousePosition) path:pop_front() print("Following path: ")