From 2d4c79484f12c9448a2a41927bd59b5dda09ca59 Mon Sep 17 00:00:00 2001 From: Thomas Christlieb Date: Wed, 28 Oct 2020 20:11:41 +0100 Subject: [PATCH] Animation mode for player should be checked (and possible changed) every tick. It needs to be changed when the player stops or starts running while follwing a path (single click, don't hold the mouse at target). Fixes #837 (#875) --- d2core/d2map/d2mapentity/player.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/d2core/d2map/d2mapentity/player.go b/d2core/d2map/d2mapentity/player.go index 30a3a840..338044ea 100644 --- a/d2core/d2map/d2mapentity/player.go +++ b/d2core/d2map/d2mapentity/player.go @@ -87,12 +87,13 @@ const ( func (p *Player) Advance(tickTime float64) { p.Step(tickTime) + if err := p.SetAnimationMode(p.GetAnimationMode()); err != nil { + fmt.Printf("failed to set animationMode to: %d, err: %v\n", p.GetAnimationMode(), err) + } + if p.IsCasting() { if p.composite.GetPlayedCount() >= 1 { p.isCasting = false - if err := p.SetAnimationMode(p.GetAnimationMode()); err != nil { - fmt.Printf("failed to set animationMode to: %d, err: %v\n", p.GetAnimationMode(), err) - } } // skills are casted after the first half of the casting animation is played