mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2025-02-07 00:56:51 -05:00
NPC path: change mode before changing directions. (#271)
We need the data of the new mode before making a decision on what direction to use.
This commit is contained in:
parent
d6769975cd
commit
0876a2953d
@ -160,9 +160,14 @@ func (v *AnimatedEntity) SetTarget(tx, ty float64, action int32) {
|
|||||||
newAnimationMode = d2enum.AnimationModeMonsterWalk.String()
|
newAnimationMode = d2enum.AnimationModeMonsterWalk.String()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if newAnimationMode != v.animationMode {
|
||||||
|
v.SetMode(newAnimationMode, v.weaponClass, v.direction)
|
||||||
|
}
|
||||||
|
|
||||||
newDirection := angleToDirection(float64(angle), v.composite.GetDirectionCount())
|
newDirection := angleToDirection(float64(angle), v.composite.GetDirectionCount())
|
||||||
if newDirection != v.GetDirection() || newAnimationMode != v.animationMode {
|
|
||||||
v.SetMode(newAnimationMode, v.weaponClass, newDirection)
|
if newDirection != v.GetDirection() {
|
||||||
|
v.SetMode(v.animationMode, v.weaponClass, newDirection)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user